22 #define SHUTDOWNCOUNT 200
25 bool fWaitForRelease = 0;
29 counter_t Joystick_Counter = 0;
30 bool fJoyWaitForRelease = 0;
31 counter_t Button_LongCounter = 0;
32 counter_t Button_Counter = 0;
38 void JOYSTICK_Handler(
void );
55 void BUTTON_Handler(
void )
68 state = BUTTON_GetNewState();
75 if ( Button_LongCounter > WEIGHTED_TIME( SHUTDOWNCOUNT ) )
80 DRAW_RestoreCharMagniCoeff();
87 DMA_LCD_UpdateScreen();
98 Button_LongCounter = 0;
105 if ( ( Button_Counter == 0 ) && ( new_state != old_state ) )
107 Button_State = new_state;
110 else if ( ( Button_Counter < WEIGHTED_TIME( ANTI_BOUNCING_COUNT ) ) && fWaitForRelease )
127 Button_State = new_state;
152 void JOYSTICK_Handler(
void )
157 new_state_joy = JOYSTICK_GetNewState();
159 if ( ( Joystick_Counter == 0 ) && ( new_state_joy != old_state_joy ) )
161 Joystick_State = new_state_joy;
164 else if ( ( Joystick_Counter < WEIGHTED_TIME( ANTI_BOUNCING_COUNT / 3 ) ) && fJoyWaitForRelease )
173 Joystick_Counter = 1;
177 Joystick_Counter = 0;
178 fJoyWaitForRelease = 0;
179 Joystick_State = new_state_joy;
211 for ( i = iter % 4; i > 0; --i )
247 #endif // JOYSTICK_AVAIL
317 if ( fWaitForRelease )
363 if ( fJoyWaitForRelease )
366 return Joystick_State;
383 fJoyWaitForRelease = 1;
386 #endif // JOYSTICK_AVAIL