Skip to content

Commit c8c3122

Browse files
author
jenkie
committed
Fix Bug in shutdown sequence
Bug could produce 5V at motor output during shutdown
1 parent edd3047 commit c8c3122

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,7 @@ void read_eeprom()
12411241

12421242
void save_shutdown()
12431243
{
1244+
digitalWrite(throttle_out,0); //turn motor off
12441245
//power saving stuff. This is critical if battery is disconnected.
12451246
EIMSK=0; //disable interrupts
12461247
cli(); //disable interrupts
@@ -1251,7 +1252,6 @@ void save_shutdown()
12511252
PRR0=B11101111; //shut down I2C, Timers, ADCs, UARTS
12521253
PRR1=B00111111; //shut down I2C, Timers, ADCs, UARTS
12531254
#endif
1254-
digitalWrite(throttle_out,0); //turn motor off
12551255

12561256
save_eeprom(); //save variables now
12571257

0 commit comments

Comments
 (0)