@@ -26,6 +26,9 @@ limitations under the License.
2626//Application related definitions
2727//------------------------------------------------------------------------------
2828#define BUTTON_DEBOUCE_TIME_MS 20
29+ #define RED_COLOR_LED_INTENSITY 600
30+ #define GREEN_COLOR_LED_INTENSITY 300
31+ #define BLUE_COLOR_LED_INTENSITY 150
2932
3033typedef enum
3134{
@@ -39,9 +42,9 @@ typedef enum
3942//------------------------------------------------------------------------------
4043static volatile BUTTON_COLOR button_color = BUTTON_COLOR_RED ;
4144static uint16_t potentiometer ;
42- static uint16_t red = 600 ;
43- static uint16_t green = 300 ;
44- static uint16_t blue = 150 ;
45+ static uint16_t red = RED_COLOR_LED_INTENSITY ;
46+ static uint16_t green = GREEN_COLOR_LED_INTENSITY ;
47+ static uint16_t blue = BLUE_COLOR_LED_INTENSITY ;
4548
4649//------------------------------------------------------------------------------
4750//Function prototypes
@@ -166,7 +169,7 @@ static void ButtonS1Debounce(void)
166169 static uint16_t debounceCounter = 0 ;
167170
168171 //Sample the button S1 to see if it is currently pressed or not.
169- if (BUTTON_IsPressed (BUTTON_S1 ))
172+ if (! BUTTON_IsPressed (BUTTON_S1 ))
170173 {
171174 //The button is currently pressed. Turn on the general purpose LED.
172175 LED1_On ();
@@ -216,7 +219,7 @@ static void ButtonS2Debounce(void)
216219 static uint16_t debounceCounter = 0 ;
217220
218221 //Sample the button S2 to see if it is currently pressed or not.
219- if (BUTTON_IsPressed (BUTTON_S2 ))
222+ if (! BUTTON_IsPressed (BUTTON_S2 ))
220223 {
221224 //The button is currently pressed. Turn on the general purpose LED.
222225 LED2_On ();
0 commit comments