Skip to content

Commit

Permalink
AP_HAL: move enabling of AP_NOTIFY_TONEALARM_ENABLED out of AP_Notify…
Browse files Browse the repository at this point in the history
…_config.h

this is looking at chibios-specific defines, which is bad
  • Loading branch information
peterbarker committed Jan 31, 2025
1 parent 1b90781 commit 57877dd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/AP_HAL/AP_HAL_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
#define HAL_REQUIRES_BDSHOT_SUPPORT (defined(HAL_WITH_BIDIR_DSHOT) || HAL_WITH_IO_MCU_BIDIR_DSHOT)
#endif

#ifndef AP_NOTIFY_TONEALARM_ENABLED
#define AP_NOTIFY_TONEALARM_ENABLED 0
#endif

// support for Extended DShot Telemetry v2 is enabled only if any kind of such telemetry
// can in principle arrive, either from servo outputs or from IOMCU

Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_HAL/board/chibios.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,7 @@
#define HAL_INS_RATE_LOOP 0
#endif
#endif

#ifndef AP_NOTIFY_TONEALARM_ENABLED
#define AP_NOTIFY_TONEALARM_ENABLED ((defined(HAL_PWM_ALARM) || HAL_DSHOT_ALARM_ENABLED))
#endif
3 changes: 3 additions & 0 deletions libraries/AP_HAL/board/linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#define HAL_INS_DEFAULT HAL_INS_NONE
#define HAL_BARO_DEFAULT HAL_BARO_NONE
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF
#define AP_NOTIFY_TONEALARM_ENABLED 1
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF
#define HAL_INS_PROBE_LIST PROBE_IMU_SPI(Invensense, "mpu9250", ROTATION_ROLL_180_YAW_270)
#else
Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_HAL/board/sitl.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@
#ifndef HAL_INS_RATE_LOOP
#define HAL_INS_RATE_LOOP 1
#endif

#ifndef AP_NOTIFY_TONEALARM_ENABLED
#define AP_NOTIFY_TONEALARM_ENABLED 1
#endif

0 comments on commit 57877dd

Please sign in to comment.