NoSloppy

Untitled

May 4th, 2021
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. virtual void On() {
  2. if (IsOn()) return;
  3. if (current_style() && current_style()->NoOnOff())
  4. return;
  5. activated_ = millis();
  6. STDOUT.println("Ignition.");
  7. MountSDCard();
  8. EnableAmplifier();
  9. SaberBase::RequestMotion();
  10.  
  11. // Avoid clashes a little bit while turning on.
  12. // It might be a "clicky" power button...
  13. IgnoreClash(1000); // BC was 300
  14.  
  15. float preon_time = 0.0;
  16. #ifdef ANGLE_PREON
  17. if (fusor.angle1() > - M_PI / 4) {
  18. SaberBase::TurnOn();
  19. } else {
  20. SaberBase::DoPreOn(&preon_time);
  21. if (preon_time > 0.0) {
  22. on_pending_ = true;
  23. on_pending_base_ = millis();
  24. on_pending_delay_ = preon_time * 1000;
  25. } else {
  26. SaberBase::TurnOn();
  27. }
  28. }
  29. #else
  30. SaberBase::DoPreOn(&preon_time);
  31. if (preon_time > 0.0) {
  32. on_pending_ = true;
  33. on_pending_base_ = millis();
  34. on_pending_delay_ = preon_time * 1000;
  35. } else {
  36. SaberBase::TurnOn();
  37. }
  38. #endif // ANGLE_PREON
  39. }
Advertisement
Add Comment
Please, Sign In to add comment