From 66167fcf43fabbf33a1ea357954a433cee4a76ff Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 5 Jun 2012 18:11:29 -0400 Subject: : Add BOARD_BUTTON_PRESSED_LEVEL. This allows boards to override the logic level of a pressed button. All Maple boards have a pressed button read HIGH, but if the opposite convention is used, isButtonPressed() will infinite loop. Make isButtonPressed() respect this setting. Signed-off-by: Marti Bolivar --- wirish/include/wirish/boards.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'wirish/include') diff --git a/wirish/include/wirish/boards.h b/wirish/include/wirish/boards.h index 73d5509..6676a02 100644 --- a/wirish/include/wirish/boards.h +++ b/wirish/include/wirish/boards.h @@ -110,13 +110,21 @@ extern void boardInit(void); */ bool boardUsesPin(uint8 pin); -/* Set derived definitions */ +/* + * Derived and default board definitions + */ + #define CLOCK_SPEED_MHZ CYCLES_PER_MICROSECOND #define CLOCK_SPEED_HZ (CLOCK_SPEED_MHZ * 1000000UL) + #ifndef SYSTICK_RELOAD_VAL #define SYSTICK_RELOAD_VAL (1000 * CYCLES_PER_MICROSECOND - 1) #endif +#ifndef BOARD_BUTTON_PRESSED_LEVEL +#define BOARD_BUTTON_PRESSED_LEVEL HIGH +#endif + /** * @brief Does the board break out a USART/UART's RX and TX pins? * -- cgit v1.2.3