File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,20 +172,25 @@ void main()
172172 {
173173 switch (state ) {
174174 case SLEEP :
175+ O_BOOST = LOW ;
176+ O_AVR_BUTTON = LOW ;
177+
175178 PCON = 0x02 ; // Stop/PowerDown Mode
176179 _nop_ (); // We need at least one NOP after waking up
180+
177181 transition_to_state (IDLE );
178182 break ;
179183
180184 case IDLE :
185+ O_AVR_BUTTON = button_state ;
186+
181187 if (button_state == LOW ){
182- O_BOOST = HIGH ; // powering the booster, avr, 5v rail
183- O_AVR_BUTTON = LOW ; // notify avr about the pressed button
184188 transition_to_state (BOOT );
185189 }
186190 break ;
187191
188192 case BOOT :
193+ O_BOOST = HIGH ; // powering the booster, avr, 5v rail
189194 O_AVR_BUTTON = button_state ;
190195
191196 if (avr_online_state == HIGH ){
@@ -202,8 +207,6 @@ void main()
202207 O_AVR_BUTTON = button_state ;
203208
204209 if (avr_online_state == LOW ) {
205- O_BOOST = LOW ;
206- O_AVR_BUTTON = LOW ;
207210 transition_to_state (SLEEP );
208211 }
209212
You can’t perform that action at this time.
0 commit comments