From 42dafc1eb2d791c1ee9de2c67a99ec7d9849a239 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 12 May 2023 08:57:25 -0700 Subject: [PATCH] imxrt:Expand ToneAlarmInterface to GPT 3 & 4 --- .../src/px4/nxp/imxrt/tone_alarm/ToneAlarmInterface.cpp | 8 ++++++++ platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platforms/nuttx/src/px4/nxp/imxrt/tone_alarm/ToneAlarmInterface.cpp b/platforms/nuttx/src/px4/nxp/imxrt/tone_alarm/ToneAlarmInterface.cpp index c864ac245e..01389b1200 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/tone_alarm/ToneAlarmInterface.cpp +++ b/platforms/nuttx/src/px4/nxp/imxrt/tone_alarm/ToneAlarmInterface.cpp @@ -72,12 +72,20 @@ # define TONE_ALARM_CLOCK_ALL() imxrt_clockall_gpt_bus() /* The Clock Gating macro for this GPT */ #elif TONE_ALARM_TIMER == 2 # define TONE_ALARM_CLOCK_ALL() imxrt_clockall_gpt2_bus() /* The Clock Gating macro for this GPT */ +#elif TONE_ALARM_TIMER == 3 +# define TONE_ALARM_CLOCK_ALL() imxrt_clockall_gpt3_bus() /* The Clock Gating macro for this GPT */ +#elif TONE_ALARM_TIMER == 4 +# define TONE_ALARM_CLOCK_ALL() imxrt_clockall_gpt4_bus() /* The Clock Gating macro for this GPT */ #endif #if TONE_ALARM_TIMER == 1 && defined(CONFIG_IMXRT_GPT1) # error must not set CONFIG_IMXRT_GPT1=y and TONE_ALARM_TIMER=1 #elif TONE_ALARM_TIMER == 2 && defined(CONFIG_IMXRT_GPT2) # error must not set CONFIG_IMXRT_GPT2=y and TONE_ALARM_TIMER=2 +#elif TONE_ALARM_TIMER == 3 && defined(CONFIG_IMXRT_GPT3) +# error must not set CONFIG_IMXRT_GPT3=y and TONE_ALARM_TIMER=3 +#elif TONE_ALARM_TIMER == 4 && defined(CONFIG_IMXRT_GPT4) +# error must not set CONFIG_IMXRT_GPT4=y and TONE_ALARM_TIMER=4 #endif diff --git a/platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt index f02125a5cf..d1bb06171c 100644 --- a/platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/rt117x/CMakeLists.txt @@ -40,7 +40,7 @@ add_subdirectory(../imxrt/board_reset board_reset) add_subdirectory(../imxrt/hrt hrt) add_subdirectory(../imxrt/led_pwm led_pwm) add_subdirectory(io_pins) -#add_subdirectory(../imxrt/tone_alarm tone_alarm) +add_subdirectory(../imxrt/tone_alarm tone_alarm) add_subdirectory(../imxrt/version version) add_subdirectory(px4io_serial)