From c8c31220041bac7029e924150b88bd5837ce92cc Mon Sep 17 00:00:00 2001 From: jenkie Date: Sat, 13 Dec 2014 22:21:23 +0100 Subject: [PATCH] Fix Bug in shutdown sequence Bug could produce 5V at motor output during shutdown --- Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino b/Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino index 6880a01..0e0d7a4 100644 --- a/Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino +++ b/Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino @@ -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 @@ -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