AP_HAL: added AP_HAL_BOARD_DRIVER define

this makes example sketches easier to read
This commit is contained in:
Andrew Tridgell 2012-12-18 20:04:20 +11:00
parent abbe37be37
commit 4cff98dcae
1 changed files with 16 additions and 0 deletions

View File

@ -15,5 +15,21 @@
#define HAL_BOARD_AVR_SITL 3
#define HAL_BOARD_EMPTY 99
/*
define AP_HAL_BOARD_DRIVER to the right hal type for this
board. This prevents us having a mess of ifdefs in every example
sketch
*/
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1
#define AP_HAL_BOARD_DRIVER AP_HAL_AVR_APM1
#elif CONFIG_HAL_BOARD == HAL_BOARD_APM2
#define AP_HAL_BOARD_DRIVER AP_HAL_AVR_APM2
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
#define AP_HAL_BOARD_DRIVER AP_HAL_AVR_SITL
#else
#error "Unknown CONFIG_HAL_BOARD type"
#endif
#endif // __AP_HAL_BOARDS_H__