From b32aab2d0ff3848fb96c17ab3c7cc0228867cb5e Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 17 Jun 2020 14:39:58 -0700 Subject: [PATCH] platform Updates for NuttX 9.1.0- --- platforms/nuttx/src/bootloader/lib/systick.c | 2 +- platforms/nuttx/src/px4/common/board_crashdump.c | 6 +++--- platforms/nuttx/src/px4/common/px4_init.cpp | 6 +++--- platforms/nuttx/src/px4/common/tasks.cpp | 2 +- .../nuttx/src/px4/nxp/imxrt/board_critmon/board_critmon.c | 2 +- .../nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp | 2 +- platforms/nuttx/src/px4/nxp/imxrt/version/board_identity.c | 2 +- .../nuttx/src/px4/nxp/imxrt/version/board_mcu_version.c | 2 +- .../nuttx/src/px4/nxp/kinetis/version/board_mcu_version.c | 2 +- .../nuttx/src/px4/nxp/s32k1xx/version/board_mcu_version.c | 2 +- .../src/px4/stm/stm32_common/board_critmon/board_critmon.c | 2 +- platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp | 2 +- .../nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h | 6 +++--- .../nuttx/src/px4/stm/stm32h7/include/px4_arch/micro_hal.h | 2 +- src/lib/drivers/led/led.cpp | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/platforms/nuttx/src/bootloader/lib/systick.c b/platforms/nuttx/src/bootloader/lib/systick.c index 482993e1d2..e75dfce485 100644 --- a/platforms/nuttx/src/bootloader/lib/systick.c +++ b/platforms/nuttx/src/bootloader/lib/systick.c @@ -31,7 +31,7 @@ * ****************************************************************************/ -#include "up_arch.h" +#include "arm_arch.h" #include "systick.h" #include diff --git a/platforms/nuttx/src/px4/common/board_crashdump.c b/platforms/nuttx/src/px4/common/board_crashdump.c index 3ba4da017a..18974cdd1a 100644 --- a/platforms/nuttx/src/px4/common/board_crashdump.c +++ b/platforms/nuttx/src/px4/common/board_crashdump.c @@ -51,7 +51,7 @@ #include -#include "up_internal.h" +#include "arm_internal.h" #include #include "nvic.h" @@ -377,14 +377,14 @@ __EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint char *dead = "Memory wiped - dump not saved!"; while (*dead) { - up_lowputc(*dead++); + arm_lowputc(*dead++); } } else if (rv == -ENOSPC) { /* hard fault again */ - up_lowputc('!'); + arm_lowputc('!'); } #endif /* BOARD_CRASHDUMP_RESET_ONLY */ diff --git a/platforms/nuttx/src/px4/common/px4_init.cpp b/platforms/nuttx/src/px4/common/px4_init.cpp index 30e6c46974..3f61885a88 100644 --- a/platforms/nuttx/src/px4/common/px4_init.cpp +++ b/platforms/nuttx/src/px4/common/px4_init.cpp @@ -78,9 +78,9 @@ int px4_platform_init(void) (void)fs_dupfd2(0, 1); (void)fs_dupfd2(0, 2); - (void)fs_fdopen(0, O_RDONLY, NULL); - (void)fs_fdopen(1, O_WROK | O_CREAT, NULL); - (void)fs_fdopen(2, O_WROK | O_CREAT, NULL); + (void)fs_fdopen(0, O_RDONLY, NULL, NULL); + (void)fs_fdopen(1, O_WROK | O_CREAT, NULL, NULL); + (void)fs_fdopen(2, O_WROK | O_CREAT, NULL, NULL); } else { /* We failed to open /dev/null OR for some reason, we opened diff --git a/platforms/nuttx/src/px4/common/tasks.cpp b/platforms/nuttx/src/px4/common/tasks.cpp index 024da933e7..132afcb41b 100644 --- a/platforms/nuttx/src/px4/common/tasks.cpp +++ b/platforms/nuttx/src/px4/common/tasks.cpp @@ -89,7 +89,7 @@ int px4_task_delete(int pid) const char *px4_get_taskname(void) { #if CONFIG_TASK_NAME_SIZE > 0 - FAR struct tcb_s *thisproc = sched_self(); + FAR struct tcb_s *thisproc = nxsched_self(); return thisproc->name; #else diff --git a/platforms/nuttx/src/px4/nxp/imxrt/board_critmon/board_critmon.c b/platforms/nuttx/src/px4/nxp/imxrt/board_critmon/board_critmon.c index 927adea930..a11632c3a6 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/board_critmon/board_critmon.c +++ b/platforms/nuttx/src/px4/nxp/imxrt/board_critmon/board_critmon.c @@ -42,7 +42,7 @@ #include #include "dwt.h" -#include "up_arch.h" +#include "arm_arch.h" #include diff --git a/platforms/nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp b/platforms/nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp index 8b19ec8694..b067e1c242 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp +++ b/platforms/nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #define PX4_IMXRT_RTC_REBOOT_REG 3 // Must be common with bootloader and: diff --git a/platforms/nuttx/src/px4/nxp/imxrt/version/board_identity.c b/platforms/nuttx/src/px4/nxp/imxrt/version/board_identity.c index f1ba79a67e..522c7400b7 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/version/board_identity.c +++ b/platforms/nuttx/src/px4/nxp/imxrt/version/board_identity.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #define CPU_UUID_BYTE_FORMAT_ORDER {3, 2, 1, 0, 7, 6, 5, 4} diff --git a/platforms/nuttx/src/px4/nxp/imxrt/version/board_mcu_version.c b/platforms/nuttx/src/px4/nxp/imxrt/version/board_mcu_version.c index cad6c43753..a9e4a07609 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/version/board_mcu_version.c +++ b/platforms/nuttx/src/px4/nxp/imxrt/version/board_mcu_version.c @@ -42,7 +42,7 @@ #include #include -#include "up_arch.h" +#include "arm_arch.h" #define DIGPROG_MINOR_SHIFT 0 #define DIGPROG_MINOR_MASK (0xff << DIGPROG_MINOR_SHIFT) diff --git a/platforms/nuttx/src/px4/nxp/kinetis/version/board_mcu_version.c b/platforms/nuttx/src/px4/nxp/kinetis/version/board_mcu_version.c index 95e44c0e14..8b0d174bc1 100644 --- a/platforms/nuttx/src/px4/nxp/kinetis/version/board_mcu_version.c +++ b/platforms/nuttx/src/px4/nxp/kinetis/version/board_mcu_version.c @@ -40,7 +40,7 @@ #include #include -#include "up_arch.h" +#include "arm_arch.h" #include "hardware/kinetis_sim.h" #define CHIP_TAG "Kinetis K??" diff --git a/platforms/nuttx/src/px4/nxp/s32k1xx/version/board_mcu_version.c b/platforms/nuttx/src/px4/nxp/s32k1xx/version/board_mcu_version.c index 222993d92a..2cb5859c1a 100644 --- a/platforms/nuttx/src/px4/nxp/s32k1xx/version/board_mcu_version.c +++ b/platforms/nuttx/src/px4/nxp/s32k1xx/version/board_mcu_version.c @@ -41,7 +41,7 @@ #include #include -#include "up_arch.h" +#include "arm_arch.h" #include "hardware/s32k1xx_sim.h" #define CHIP_TAG "S32K1XX" diff --git a/platforms/nuttx/src/px4/stm/stm32_common/board_critmon/board_critmon.c b/platforms/nuttx/src/px4/stm/stm32_common/board_critmon/board_critmon.c index e57031d94d..7b05384ab7 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/board_critmon/board_critmon.c +++ b/platforms/nuttx/src/px4/stm/stm32_common/board_critmon/board_critmon.c @@ -42,7 +42,7 @@ #include #include "dwt.h" -#include "up_arch.h" +#include "arm_arch.h" #include diff --git a/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp b/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp index 96bc37530e..a4e12318b6 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp +++ b/platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include diff --git a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h index 20754b7cd0..9f506182b1 100644 --- a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h +++ b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h @@ -40,7 +40,7 @@ __BEGIN_DECLS #define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_STM32F7 #include #include -#include //include up_systemreset() which is included on stm32.h +#include //include up_systemreset() which is included on stm32.h #include #define PX4_BBSRAM_SIZE STM32F7_BBSRAM_SIZE #define PX4_BBSRAM_GETDESC_IOCTL STM32F7_BBSRAM_GETDESC_IOCTL @@ -48,8 +48,8 @@ __BEGIN_DECLS #define PX4_NUMBER_I2C_BUSES STM32F7_NI2C #define PX4_ARCH_DCACHE_LINESIZE ARMV7M_DCACHE_LINESIZE -void stm32_flash_lock(void); -void stm32_flash_unlock(void); +int stm32_flash_lock(void); +int stm32_flash_unlock(void); int stm32_flash_writeprotect(size_t page, bool enabled); __END_DECLS diff --git a/platforms/nuttx/src/px4/stm/stm32h7/include/px4_arch/micro_hal.h b/platforms/nuttx/src/px4/stm/stm32h7/include/px4_arch/micro_hal.h index 515a3c47e3..8784e2cf36 100644 --- a/platforms/nuttx/src/px4/stm/stm32h7/include/px4_arch/micro_hal.h +++ b/platforms/nuttx/src/px4/stm/stm32h7/include/px4_arch/micro_hal.h @@ -53,7 +53,7 @@ __BEGIN_DECLS #include #include -#include //include up_systemreset() which is included on stm32.h +#include //include up_systemreset() which is included on stm32.h #include #define PX4_BBSRAM_SIZE STM32H7_BBSRAM_SIZE #define PX4_BBSRAM_GETDESC_IOCTL STM32H7_BBSRAM_GETDESC_IOCTL diff --git a/src/lib/drivers/led/led.cpp b/src/lib/drivers/led/led.cpp index 99b80550ac..c99ddfe2e5 100644 --- a/src/lib/drivers/led/led.cpp +++ b/src/lib/drivers/led/led.cpp @@ -43,7 +43,7 @@ #include /* - * Ideally we'd be able to get these from up_internal.h, + * Ideally we'd be able to get these from arm_internal.h, * but since we want to be able to disable the NuttX use * of leds for system indication at will and there is no * separate switch, we need to build independent of the