Skip to content

Commit

Permalink
Fix Bug in shutdown sequence
Browse files Browse the repository at this point in the history
Bug could produce 5V at motor output during shutdown
  • Loading branch information
jenkie committed Dec 13, 2014
1 parent edd3047 commit c8c3122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ void read_eeprom()

void save_shutdown()
{
digitalWrite(throttle_out,0); //turn motor off
//power saving stuff. This is critical if battery is disconnected.
EIMSK=0; //disable interrupts
cli(); //disable interrupts
Expand All @@ -1251,7 +1252,6 @@ void save_shutdown()
PRR0=B11101111; //shut down I2C, Timers, ADCs, UARTS
PRR1=B00111111; //shut down I2C, Timers, ADCs, UARTS
#endif
digitalWrite(throttle_out,0); //turn motor off

save_eeprom(); //save variables now

Expand Down

0 comments on commit c8c3122

Please sign in to comment.