diff --git a/bootloader/makefile b/bootloader/makefile index ed8cbfce29..90ba7aa7a7 100644 --- a/bootloader/makefile +++ b/bootloader/makefile @@ -3,7 +3,7 @@ BOOTLOADER_MODULE_PATH=. PLATFORM_DFU=0x8000000 BUILD_PATH_EXT = $(BOOTLOADER_BUILD_PATH_EXT) -ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","p2" "trackerm")) +ifeq ($(PLATFORM_MCU),rtl872x) RTL_BINARY_FLASH_START = 0x4000 endif diff --git a/bootloader/prebootloader/makefile b/bootloader/prebootloader/makefile index 577d331bc5..c6f9b05bfa 100644 --- a/bootloader/prebootloader/makefile +++ b/bootloader/prebootloader/makefile @@ -10,12 +10,7 @@ include $(PROJECT_ROOT)/build/macros.mk include $(PROJECT_ROOT)/build/module-defaults.mk include $(PROJECT_ROOT)/build/arm-tools.mk -# overwrite if PLATFORM_DYNALIB_MODULES is trackerm to use the same prebl as tron -ifeq ("$(PLATFORM_DYNALIB_MODULES)", "trackerm") -PLATFORM_DYNALIB_MODULES=tron -endif - -projects = $(sort $(wildcard $(current_dir)/src/$(PLATFORM_DYNALIB_MODULES)/*)) +projects = $(sort $(wildcard $(current_dir)/src/$(PLATFORM_MCU)/*)) makefiles = $(foreach module,$(projects),$(and $(strip $(subst $(MODULE_EXCLUDE),,$(notdir $(module)))),$(wildcard $(module)/makefile))) SUBDIR_GOALS := $(MAKECMDGOALS) diff --git a/bootloader/prebootloader/src/tron/mbr/bootloader_update.c b/bootloader/prebootloader/src/rtl872x/mbr/bootloader_update.c similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/bootloader_update.c rename to bootloader/prebootloader/src/rtl872x/mbr/bootloader_update.c diff --git a/bootloader/prebootloader/src/tron/mbr/bootloader_update.h b/bootloader/prebootloader/src/rtl872x/mbr/bootloader_update.h similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/bootloader_update.h rename to bootloader/prebootloader/src/rtl872x/mbr/bootloader_update.h diff --git a/bootloader/prebootloader/src/tron/mbr/build.mk b/bootloader/prebootloader/src/rtl872x/mbr/build.mk similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/build.mk rename to bootloader/prebootloader/src/rtl872x/mbr/build.mk diff --git a/bootloader/prebootloader/src/tron/mbr/cxx_constructors.cpp b/bootloader/prebootloader/src/rtl872x/mbr/cxx_constructors.cpp similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/cxx_constructors.cpp rename to bootloader/prebootloader/src/rtl872x/mbr/cxx_constructors.cpp diff --git a/bootloader/prebootloader/src/tron/mbr/import.mk b/bootloader/prebootloader/src/rtl872x/mbr/import.mk similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/import.mk rename to bootloader/prebootloader/src/rtl872x/mbr/import.mk diff --git a/bootloader/prebootloader/src/tron/mbr/include.mk b/bootloader/prebootloader/src/rtl872x/mbr/include.mk similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/include.mk rename to bootloader/prebootloader/src/rtl872x/mbr/include.mk diff --git a/bootloader/prebootloader/src/tron/mbr/linker.ld b/bootloader/prebootloader/src/rtl872x/mbr/linker.ld similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/linker.ld rename to bootloader/prebootloader/src/rtl872x/mbr/linker.ld diff --git a/bootloader/prebootloader/src/tron/mbr/main.cpp b/bootloader/prebootloader/src/rtl872x/mbr/main.cpp similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/main.cpp rename to bootloader/prebootloader/src/rtl872x/mbr/main.cpp diff --git a/bootloader/prebootloader/src/tron/mbr/makefile b/bootloader/prebootloader/src/rtl872x/mbr/makefile similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/makefile rename to bootloader/prebootloader/src/rtl872x/mbr/makefile diff --git a/bootloader/prebootloader/src/tron/mbr/module_info.c b/bootloader/prebootloader/src/rtl872x/mbr/module_info.c similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/module_info.c rename to bootloader/prebootloader/src/rtl872x/mbr/module_info.c diff --git a/bootloader/prebootloader/src/tron/mbr/part1_import.c b/bootloader/prebootloader/src/rtl872x/mbr/part1_import.c similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/part1_import.c rename to bootloader/prebootloader/src/rtl872x/mbr/part1_import.c diff --git a/bootloader/prebootloader/src/tron/mbr/part1_preinit_import.c b/bootloader/prebootloader/src/rtl872x/mbr/part1_preinit_import.c similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/part1_preinit_import.c rename to bootloader/prebootloader/src/rtl872x/mbr/part1_preinit_import.c diff --git a/bootloader/prebootloader/src/tron/mbr/rtl_header.cpp b/bootloader/prebootloader/src/rtl872x/mbr/rtl_header.cpp similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/rtl_header.cpp rename to bootloader/prebootloader/src/rtl872x/mbr/rtl_header.cpp diff --git a/bootloader/prebootloader/src/tron/mbr/rtl_it.c b/bootloader/prebootloader/src/rtl872x/mbr/rtl_it.c similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/rtl_it.c rename to bootloader/prebootloader/src/rtl872x/mbr/rtl_it.c diff --git a/bootloader/prebootloader/src/tron/mbr/rtl_it.h b/bootloader/prebootloader/src/rtl872x/mbr/rtl_it.h similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/rtl_it.h rename to bootloader/prebootloader/src/rtl872x/mbr/rtl_it.h diff --git a/bootloader/prebootloader/src/tron/mbr/sources.mk b/bootloader/prebootloader/src/rtl872x/mbr/sources.mk similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/sources.mk rename to bootloader/prebootloader/src/rtl872x/mbr/sources.mk diff --git a/bootloader/prebootloader/src/tron/mbr/tlm.mk b/bootloader/prebootloader/src/rtl872x/mbr/tlm.mk similarity index 100% rename from bootloader/prebootloader/src/tron/mbr/tlm.mk rename to bootloader/prebootloader/src/rtl872x/mbr/tlm.mk diff --git a/bootloader/prebootloader/src/tron/part1/build.mk b/bootloader/prebootloader/src/rtl872x/part1/build.mk similarity index 100% rename from bootloader/prebootloader/src/tron/part1/build.mk rename to bootloader/prebootloader/src/rtl872x/part1/build.mk diff --git a/bootloader/prebootloader/src/tron/part1/cxx_constructors.cpp b/bootloader/prebootloader/src/rtl872x/part1/cxx_constructors.cpp similarity index 100% rename from bootloader/prebootloader/src/tron/part1/cxx_constructors.cpp rename to bootloader/prebootloader/src/rtl872x/part1/cxx_constructors.cpp diff --git a/bootloader/prebootloader/src/tron/part1/import.mk b/bootloader/prebootloader/src/rtl872x/part1/import.mk similarity index 100% rename from bootloader/prebootloader/src/tron/part1/import.mk rename to bootloader/prebootloader/src/rtl872x/part1/import.mk diff --git a/bootloader/prebootloader/src/tron/part1/include.mk b/bootloader/prebootloader/src/rtl872x/part1/include.mk similarity index 100% rename from bootloader/prebootloader/src/tron/part1/include.mk rename to bootloader/prebootloader/src/rtl872x/part1/include.mk diff --git a/bootloader/prebootloader/src/tron/part1/ipc.c b/bootloader/prebootloader/src/rtl872x/part1/ipc.c similarity index 100% rename from bootloader/prebootloader/src/tron/part1/ipc.c rename to bootloader/prebootloader/src/rtl872x/part1/ipc.c diff --git a/bootloader/prebootloader/src/tron/part1/linker.ld b/bootloader/prebootloader/src/rtl872x/part1/linker.ld similarity index 100% rename from bootloader/prebootloader/src/tron/part1/linker.ld rename to bootloader/prebootloader/src/rtl872x/part1/linker.ld diff --git a/bootloader/prebootloader/src/tron/part1/makefile b/bootloader/prebootloader/src/rtl872x/part1/makefile similarity index 100% rename from bootloader/prebootloader/src/tron/part1/makefile rename to bootloader/prebootloader/src/rtl872x/part1/makefile diff --git a/bootloader/prebootloader/src/tron/part1/module_info.c b/bootloader/prebootloader/src/rtl872x/part1/module_info.c similarity index 100% rename from bootloader/prebootloader/src/tron/part1/module_info.c rename to bootloader/prebootloader/src/rtl872x/part1/module_info.c diff --git a/bootloader/prebootloader/src/tron/part1/part1_export.c b/bootloader/prebootloader/src/rtl872x/part1/part1_export.c similarity index 100% rename from bootloader/prebootloader/src/tron/part1/part1_export.c rename to bootloader/prebootloader/src/rtl872x/part1/part1_export.c diff --git a/bootloader/prebootloader/src/tron/part1/rtl_support.c b/bootloader/prebootloader/src/rtl872x/part1/rtl_support.c similarity index 100% rename from bootloader/prebootloader/src/tron/part1/rtl_support.c rename to bootloader/prebootloader/src/rtl872x/part1/rtl_support.c diff --git a/bootloader/prebootloader/src/tron/part1/rtl_support.h b/bootloader/prebootloader/src/rtl872x/part1/rtl_support.h similarity index 100% rename from bootloader/prebootloader/src/tron/part1/rtl_support.h rename to bootloader/prebootloader/src/rtl872x/part1/rtl_support.h diff --git a/bootloader/prebootloader/src/tron/part1/sleep_handler.cpp b/bootloader/prebootloader/src/rtl872x/part1/sleep_handler.cpp similarity index 100% rename from bootloader/prebootloader/src/tron/part1/sleep_handler.cpp rename to bootloader/prebootloader/src/rtl872x/part1/sleep_handler.cpp diff --git a/bootloader/prebootloader/src/tron/part1/sleep_handler.h b/bootloader/prebootloader/src/rtl872x/part1/sleep_handler.h similarity index 100% rename from bootloader/prebootloader/src/tron/part1/sleep_handler.h rename to bootloader/prebootloader/src/rtl872x/part1/sleep_handler.h diff --git a/bootloader/prebootloader/src/tron/part1/sources.mk b/bootloader/prebootloader/src/rtl872x/part1/sources.mk similarity index 91% rename from bootloader/prebootloader/src/tron/part1/sources.mk rename to bootloader/prebootloader/src/rtl872x/part1/sources.mk index 67731b3bf3..fc02d68a2e 100644 --- a/bootloader/prebootloader/src/tron/part1/sources.mk +++ b/bootloader/prebootloader/src/rtl872x/part1/sources.mk @@ -12,9 +12,7 @@ CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/flash_common.cpp CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/km0_km4_ipc.cpp CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/pinmap_hal.cpp -ifeq ("$(PLATFORM_NAME)",$(filter "$(PLATFORM_NAME)","p2" "trackerm")) CPPSRC += $(PROJECT_ROOT)/hal/src/$(PLATFORM_NAME)/pinmap_defines.cpp -endif LDFLAGS += -T$(PREBOOTLOADER_PART1_SRC_PATH)/linker.ld LINKER_DEPS += $(PREBOOTLOADER_PART1_SRC_PATH)/linker.ld diff --git a/bootloader/prebootloader/src/tron/part1/tlm.mk b/bootloader/prebootloader/src/rtl872x/part1/tlm.mk similarity index 100% rename from bootloader/prebootloader/src/tron/part1/tlm.mk rename to bootloader/prebootloader/src/rtl872x/part1/tlm.mk diff --git a/bootloader/prebootloader/src/tron/part1/update_handler.c b/bootloader/prebootloader/src/rtl872x/part1/update_handler.c similarity index 100% rename from bootloader/prebootloader/src/tron/part1/update_handler.c rename to bootloader/prebootloader/src/rtl872x/part1/update_handler.c diff --git a/bootloader/prebootloader/src/tron/part1/update_handler.h b/bootloader/prebootloader/src/rtl872x/part1/update_handler.h similarity index 100% rename from bootloader/prebootloader/src/tron/part1/update_handler.h rename to bootloader/prebootloader/src/rtl872x/part1/update_handler.h diff --git a/bootloader/prebootloader/src/tron/shared/bootloader_part1_export.ld b/bootloader/prebootloader/src/rtl872x/shared/bootloader_part1_export.ld similarity index 100% rename from bootloader/prebootloader/src/tron/shared/bootloader_part1_export.ld rename to bootloader/prebootloader/src/rtl872x/shared/bootloader_part1_export.ld diff --git a/bootloader/prebootloader/src/tron/shared/crc32_nolookup.c b/bootloader/prebootloader/src/rtl872x/shared/crc32_nolookup.c similarity index 100% rename from bootloader/prebootloader/src/tron/shared/crc32_nolookup.c rename to bootloader/prebootloader/src/rtl872x/shared/crc32_nolookup.c diff --git a/bootloader/prebootloader/src/tron/shared/include.mk b/bootloader/prebootloader/src/rtl872x/shared/include.mk similarity index 100% rename from bootloader/prebootloader/src/tron/shared/include.mk rename to bootloader/prebootloader/src/rtl872x/shared/include.mk diff --git a/bootloader/prebootloader/src/tron/shared/part1_dynalib.h b/bootloader/prebootloader/src/rtl872x/shared/part1_dynalib.h similarity index 100% rename from bootloader/prebootloader/src/tron/shared/part1_dynalib.h rename to bootloader/prebootloader/src/rtl872x/shared/part1_dynalib.h diff --git a/bootloader/prebootloader/src/tron/shared/part1_preinit_dynalib.h b/bootloader/prebootloader/src/rtl872x/shared/part1_preinit_dynalib.h similarity index 100% rename from bootloader/prebootloader/src/tron/shared/part1_preinit_dynalib.h rename to bootloader/prebootloader/src/rtl872x/shared/part1_preinit_dynalib.h diff --git a/bootloader/src/main.c b/bootloader/src/main.c index 0b7bd6e9fe..e4332c1611 100644 --- a/bootloader/src/main.c +++ b/bootloader/src/main.c @@ -32,7 +32,7 @@ #include "button_hal.h" #include "dct.h" #include "feature_flags.h" -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #include "rtl8721d.h" #include "nonsecure.h" #endif @@ -48,7 +48,7 @@ extern void HAL_DFU_Process(); void platform_startup(); -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X static void jump_to_system(uint32_t addr, uint32_t sp) { nonsecure_jump_to_system(addr); (void) sp; diff --git a/build/module.mk b/build/module.mk index 72f7d67365..7725e9dbc7 100644 --- a/build/module.mk +++ b/build/module.mk @@ -102,7 +102,7 @@ exe: $(TARGET_BASE)$(EXECUTABLE_EXTENSION) none: ; -ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","p2" "trackerm")) +ifeq ($(PLATFORM_MCU),rtl872x) .PHONY: rtl-flash rtl_module_start_address = $(subst 0x08,0x00,$(call get_module_start_address)) rtl-flash: diff --git a/dynalib/inc/dynalib.h b/dynalib/inc/dynalib.h index f7560d5ebd..357eb102be 100644 --- a/dynalib/inc/dynalib.h +++ b/dynalib/inc/dynalib.h @@ -125,7 +125,7 @@ constexpr T2* dynalib_checked_cast(T2 *p) { #define __S(x) #x #define __SX(x) __S(x) - #if (PLATFORM_ID == 32 || PLATFORM_ID == 28) + #if HAL_PLATFORM_DYNALIB_DYNAMIC_LOCATION #define DYNALIB_FN_IMPORT(index, tablename, name, counter) \ DYNALIB_STATIC_ASSERT(index == counter, "Index of the dynamically exported function has changed"); \ const char check_name_##tablename_##name[0]={}; /* this will fail if the name is already defined */ \ diff --git a/dynalib/inc/module_info.inc b/dynalib/inc/module_info.inc index cdd242c630..6310d93f8e 100644 --- a/dynalib/inc/module_info.inc +++ b/dynalib/inc/module_info.inc @@ -91,7 +91,7 @@ extern "C" { extern char link_module_start; extern char link_module_end; -#if PLATFORM_ID == 32 || PLATFORM_ID == 28 +#if HAL_PLATFORM_RTL872X extern uintptr_t link_dynalib_start; extern uintptr_t link_dynalib_flash_start; #endif diff --git a/hal/inc/hal_platform.h b/hal/inc/hal_platform.h index 5f07a48476..ad7fce81d7 100644 --- a/hal/inc/hal_platform.h +++ b/hal/inc/hal_platform.h @@ -513,4 +513,8 @@ #define HAL_PLATFORM_CELLULAR_MODEM_VOLTAGE_TRANSLATOR (1) #endif // HAL_PLATFORM_CELLULAR_MODEM_VOLTAGE_TRANSLATOR +#ifndef HAL_PLATFORM_DYNALIB_DYNAMIC_LOCATION +#define HAL_PLATFORM_DYNALIB_DYNAMIC_LOCATION (0) +#endif + #endif /* HAL_PLATFORM_H */ diff --git a/hal/src/rtl872x/hal_platform_rtl8721x_config.h b/hal/src/rtl872x/hal_platform_rtl8721x_config.h index 66a3d28fe1..3ae9c86695 100644 --- a/hal/src/rtl872x/hal_platform_rtl8721x_config.h +++ b/hal/src/rtl872x/hal_platform_rtl8721x_config.h @@ -38,8 +38,6 @@ #define HAL_PLATFORM_BLE_SETUP (1) -#define HAL_PLATFORM_WIFI (1) - #define HAL_PLATFORM_RTL872X (1) /* 25 seconds */ @@ -55,8 +53,6 @@ #define HAL_PLATFORM_I2C2 (1) -#define HAL_PLATFORM_USART2 (0) - #define HAL_PLATFORM_USART3 (1) #define HAL_PLATFORM_USB_VENDOR_REQUEST (1) @@ -130,3 +126,5 @@ #define HAL_PLATFORM_SYSTEM_POOL_SIZE 1024 #define HAL_PLATFORM_MODULE_SUFFIX_EXTENSIONS (1) + +#define HAL_PLATFORM_DYNALIB_DYNAMIC_LOCATION (1) diff --git a/hal/src/rtl872x/pinmap_impl.h b/hal/src/rtl872x/pinmap_impl.h index 2caf765893..9a0caf728b 100644 --- a/hal/src/rtl872x/pinmap_impl.h +++ b/hal/src/rtl872x/pinmap_impl.h @@ -31,7 +31,7 @@ typedef struct hal_pin_info_t { uint8_t adc_channel; uint8_t pwm_instance; uint8_t pwm_channel; -#if HAL_PLATFORM_IO_EXTENSION || HAL_PLATFORM_DEMUX +#if HAL_PLATFORM_IO_EXTENSION hal_pin_type_t type; #endif // HAL_PLATFORM_IO_EXTENSION uint32_t user_data; diff --git a/hal/src/trackerm/hal_platform_config.h b/hal/src/trackerm/hal_platform_config.h index ef1e43ae15..a20d1f9295 100644 --- a/hal/src/trackerm/hal_platform_config.h +++ b/hal/src/trackerm/hal_platform_config.h @@ -11,9 +11,8 @@ // #define HAL_PLATFORM_MUXER_MAY_NEED_DELAY_IN_TX (1) #define HAL_PLATFORM_SPI_NUM (2) #define HAL_PLATFORM_I2C_NUM (2) -#define HAL_PLATFORM_USART_NUM (2) +#define HAL_PLATFORM_USART_NUM (3) #define HAL_PLATFORM_NCP_COUNT (1) -#define HAL_PLATFORM_BROKEN_MTU (1) #undef HAL_PLATFORM_WIFI #define HAL_PLATFORM_WIFI (0) // #define HAL_PLATFORM_WIFI_COMPAT (1) @@ -44,4 +43,4 @@ #define HAL_PLATFORM_USB_PRODUCT_STRING "TrackerM DFU Mode" #endif // defined(MODULE_FUNCTION) && MODULE_FUNCTION != 2 // MOD_FUNC_BOOTLOADER -#define PRODUCT_SERIES "TrackerM" +#define PRODUCT_SERIES "Tracker" diff --git a/hal/src/trackerm/include.mk b/hal/src/trackerm/include.mk index daa1e414b3..c2c03f0f08 100644 --- a/hal/src/trackerm/include.mk +++ b/hal/src/trackerm/include.mk @@ -4,15 +4,13 @@ # based on the root of the project INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) -# FIXME: Double check if this line is required. -# INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi ifneq (,$(findstring platform,$(DEPENDENCIES))) INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/cellular endif ifneq (,$(findstring platform,$(DEPENDENCIES))) -INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/esp32 +INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/realtek INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi endif diff --git a/hal/src/trackerm/network/network.cpp b/hal/src/trackerm/network/network.cpp index d5c0c199e4..372667e0c2 100644 --- a/hal/src/trackerm/network/network.cpp +++ b/hal/src/trackerm/network/network.cpp @@ -167,11 +167,7 @@ int if_init_platform(void*) { } if (HAL_Feature_Get(FEATURE_ETHERNET_DETECTION)) { -#if PLATFORM_ID == PLATFORM_ARGON || PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM en2 = new WizNetif(HAL_SPI_INTERFACE1, D5, D3, D4, mac); -#else // A SoM - en2 = new WizNetif(HAL_SPI_INTERFACE1, D8, A7, D22, mac); -#endif } uint8_t dummy; @@ -197,6 +193,8 @@ int if_init_platform(void*) { } /* TODO: wl4 - ESP32 NCP Access Point */ + reserve_netif_index(); + reserve_netif_index(); (void)wl4; auto m = mallinfo(); diff --git a/hal/src/trackerm/ota_flash_hal.cpp b/hal/src/trackerm/ota_flash_hal.cpp index d1b4919495..2b7845b982 100644 --- a/hal/src/trackerm/ota_flash_hal.cpp +++ b/hal/src/trackerm/ota_flash_hal.cpp @@ -3,7 +3,7 @@ * @file ota_flash_hal.cpp * @author Matthew McGowan, Satish Nair * @version V1.0.0 - * @date 25-Sept-2014 + * @date 27-Jul-2022 * @brief ****************************************************************************** Copyright (c) 2013-2015 Particle Industries, Inc. All rights reserved. diff --git a/hal/src/trackerm/platform_ncp_quectel.cpp b/hal/src/trackerm/platform_ncp_quectel.cpp index c17875b29f..8f9f32adf7 100644 --- a/hal/src/trackerm/platform_ncp_quectel.cpp +++ b/hal/src/trackerm/platform_ncp_quectel.cpp @@ -39,7 +39,6 @@ bool isValidNcpId(uint8_t id) { } const auto NCP_IDX_PRIMARY_QUECTEL = 0; -const auto NCP_IDX_SECONDARY_ESP32 = 1; } // unnamed @@ -64,9 +63,6 @@ int platform_ncp_get_info(int idx, PlatformNCPInfo* info) { if (idx == NCP_IDX_PRIMARY_QUECTEL) { info->identifier = platform_primary_ncp_identifier(); info->updatable = false; - } else if (idx == NCP_IDX_SECONDARY_ESP32) { - info->identifier = PLATFORM_NCP_ESP32; - info->updatable = true; } return 0; } diff --git a/hal/src/tron/hal_platform_config.h b/hal/src/tron/hal_platform_config.h index 7f1315cfd6..5c20d01a3b 100644 --- a/hal/src/tron/hal_platform_config.h +++ b/hal/src/tron/hal_platform_config.h @@ -4,6 +4,7 @@ #include "platforms.h" #define HAL_PLATFORM_NCP (1) +#define HAL_PLATFORM_USART2 (1) #define HAL_PLATFORM_NCP_AT (0) #define HAL_PLATFORM_CELLULAR (0) // #define HAL_PLATFORM_CELLULAR_SERIAL (HAL_USART_SERIAL2) @@ -11,7 +12,7 @@ // #define HAL_PLATFORM_MUXER_MAY_NEED_DELAY_IN_TX (1) #define HAL_PLATFORM_SPI_NUM (2) #define HAL_PLATFORM_I2C_NUM (2) -#define HAL_PLATFORM_USART_NUM (2) +#define HAL_PLATFORM_USART_NUM (3) #define HAL_PLATFORM_NCP_COUNT (1) #define HAL_PLATFORM_BROKEN_MTU (1) #define HAL_PLATFORM_WIFI_COMPAT (1) diff --git a/hal/src/tron/network/network.cpp b/hal/src/tron/network/network.cpp index cb42f820cb..1d3e8c6713 100644 --- a/hal/src/tron/network/network.cpp +++ b/hal/src/tron/network/network.cpp @@ -119,11 +119,7 @@ int if_init_platform(void*) { } if (HAL_Feature_Get(FEATURE_ETHERNET_DETECTION)) { -#if PLATFORM_ID == PLATFORM_ARGON || PLATFORM_ID == PLATFORM_P2 en2 = new WizNetif(HAL_SPI_INTERFACE1, D5, D3, D4, mac); -#else // A SoM - en2 = new WizNetif(HAL_SPI_INTERFACE1, D8, A7, D22, mac); -#endif } uint8_t dummy; diff --git a/hal/src/uhura/include.mk b/hal/src/uhura/include.mk deleted file mode 100644 index 6a93b0ec0c..0000000000 --- a/hal/src/uhura/include.mk +++ /dev/null @@ -1,19 +0,0 @@ - -# Define the prefix to this directory. -# Note: The name must be unique within this build and should be -# based on the root of the project - -INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) -# # FIXME: There is no NCP on TRACKERM??? check this please -# INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi - -ifneq (,$(findstring platform,$(DEPENDENCIES))) -INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/cellular -endif - -ifneq (,$(findstring platform,$(DEPENDENCIES))) -INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/esp32 -INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi -endif - -include $(TARGET_HAL_PATH)/src/rtl872x/include.mk \ No newline at end of file diff --git a/main/makefile b/main/makefile index 7cd43d714e..0077545380 100644 --- a/main/makefile +++ b/main/makefile @@ -76,7 +76,7 @@ BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)$(USER_FLAVOR) USE_PRINTF_FLOAT ?= y -ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","p2" "trackerm")) +ifeq ($(PLATFORM_MCU),rtl872x) RTL_BINARY_FLASH_START = 0x60000 endif diff --git a/modules/shared/system_module_version.mk b/modules/shared/system_module_version.mk index 30f95d4506..fcb8fe05d4 100644 --- a/modules/shared/system_module_version.mk +++ b/modules/shared/system_module_version.mk @@ -16,12 +16,7 @@ USER_PART_MODULE_VERSION ?= 6 # Bump by 1 for every updated bootloader image for a release with the same v0.x.* base. BOOTLOADER_VERSION ?= 2000 -ifeq ($(PLATFORM_ID),32) -PREBOOTLOADER_MBR_VERSION ?= 2 -PREBOOTLOADER_PART1_VERSION ?= 3 -endif - -ifeq ($(PLATFORM_ID),28) +ifeq ($(PLATFORM_MCU),rtl872x) PREBOOTLOADER_MBR_VERSION ?= 2 PREBOOTLOADER_PART1_VERSION ?= 3 endif @@ -29,22 +24,7 @@ endif # The version of the bootloader that the system firmware requires # NOTE: this will force the device into safe mode until this dependency is met, which is why # this version usually lags behind the current bootloader version, to avoid non-mandatory updates. -ifeq ($(PLATFORM_ID),32) -BOOTLOADER_DEPENDENCY = 2000 -else ifeq ($(PLATFORM_GEN),3) -BOOTLOADER_DEPENDENCY = 1101 -else -# Some sensible default -BOOTLOADER_DEPENDENCY = 0 -endif -ifeq ($(PLATFORM_ID),32) -PREBOOTLOADER_PART1_DEPENDENCY = 3 -endif - -# The version of the bootloader that the system firmware requires for 28 -# NOTE: this will force the device into safe mode until this dependency is met, which is why -# this version usually lags behind the current bootloader version, to avoid non-mandatory updates. -ifeq ($(PLATFORM_ID),28) +ifeq ($(PLATFORM_MCU),rtl872x) BOOTLOADER_DEPENDENCY = 2000 else ifeq ($(PLATFORM_GEN),3) BOOTLOADER_DEPENDENCY = 1101 @@ -52,7 +32,7 @@ else # Some sensible default BOOTLOADER_DEPENDENCY = 0 endif -ifeq ($(PLATFORM_ID),28) +ifeq ($(PLATFORM_MCU),rtl872x) PREBOOTLOADER_PART1_DEPENDENCY = 3 endif @@ -90,7 +70,7 @@ endif endif endif # ($(PLATFORM_MCU),nRF52840) -ifeq ($(PLATFORM_ID),$(filter $(PLATFORM_ID),28 32)) +ifeq ($(PLATFORM_MCU),rtl872x) SYSTEM_PART1_MODULE_DEPENDENCY ?= ${MODULE_FUNCTION_BOOTLOADER},0,${BOOTLOADER_DEPENDENCY} BOOTLOADER_MODULE_DEPENDENCY ?= ${MODULE_FUNCTION_BOOTLOADER},2,${PREBOOTLOADER_PART1_DEPENDENCY} endif diff --git a/modules/trackerm/system-part1/module_system_part1_export.ld b/modules/trackerm/system-part1/module_system_part1_export.ld index b462a40a41..93237b9b9f 100644 --- a/modules/trackerm/system-part1/module_system_part1_export.ld +++ b/modules/trackerm/system-part1/module_system_part1_export.ld @@ -26,3 +26,4 @@ PROVIDE (link_dynalib_location_offset_hal_wlan = 92); PROVIDE (link_dynalib_location_offset_hal_ble = 96); PROVIDE (link_dynalib_location_offset_hal_posix_syscall = 100); PROVIDE (link_dynalib_location_offset_hal_storage = 104); +PROVIDE (link_dynalib_location_offset_hal_cellular = 108); diff --git a/platform/MCU/rtl872x/inc/platform_config.h b/platform/MCU/rtl872x/inc/platform_config.h index 9b4183d9bb..8ca53d4e1b 100644 --- a/platform/MCU/rtl872x/inc/platform_config.h +++ b/platform/MCU/rtl872x/inc/platform_config.h @@ -47,7 +47,7 @@ #define SYSTICK_IRQ_PRIORITY 7 //CORTEX_M33 Systick Interrupt -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #define INTERNAL_FLASH_SIZE (0x800000) #else #pragma message "PLATFORM_ID is " PREPSTRING(PLATFORM_ID) diff --git a/system/src/control/wifi_new.cpp b/system/src/control/wifi_new.cpp index 07ff869cb8..b55c5c5e21 100644 --- a/system/src/control/wifi_new.cpp +++ b/system/src/control/wifi_new.cpp @@ -92,7 +92,7 @@ int joinNewNetwork(ctrl_request* req) { CHECK_TRUE(ncpClient, SYSTEM_ERROR_UNKNOWN); const NcpClientLock lock(ncpClient); // FIXME; the security sent from the mobile app is always zero. -#if (PLATFORM_ID == 32 || PLATFORM_ID == 28) +#if HAL_PLATFORM_RTL872X // Scan for networks Vector networks; CHECK(ncpClient->scan([](WifiScanResult network, void* data) -> int { diff --git a/system/src/system_sleep.cpp b/system/src/system_sleep.cpp index ede51b0f10..364f2d1458 100644 --- a/system/src/system_sleep.cpp +++ b/system/src/system_sleep.cpp @@ -80,7 +80,7 @@ network_status_t system_sleep_network_suspend(network_interface_index index) { } } #endif -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X // P2 doesn't need to turn off the modem manually system_notify_event(network_status, network_status_off); #else diff --git a/user/inc/Arduino.h b/user/inc/Arduino.h index 99620f1f0f..4d4acb6771 100644 --- a/user/inc/Arduino.h +++ b/user/inc/Arduino.h @@ -91,7 +91,7 @@ inline void yield() { #endif #ifndef analogInputToDigitalPin -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #define analogInputToDigitalPin(p) ((p) == 3 ? 0 : \ ((p) == 4 ? 1 : \ ((p) == 5 ? 14 : \ diff --git a/user/tests/wiring/no_fixture/i2c.cpp b/user/tests/wiring/no_fixture/i2c.cpp index 31159ec56c..74ab16c6c9 100644 --- a/user/tests/wiring/no_fixture/i2c.cpp +++ b/user/tests/wiring/no_fixture/i2c.cpp @@ -271,9 +271,8 @@ test(I2C_04_Serial1_Cannot_Be_Enabled_While_Wire3_Is_Enabled) { #endif // PLATFORM_ID == PLATFORM_TRACKER -#if !HAL_PLATFORM_RTL872X -test(I2C_05_Hal_Sleep_API_Test) { Hal_Sleep_API_Test +test(I2C_05_Hal_Sleep_API_Test) { Wire.lock(); bool enabled = Wire.isEnabled(); SCOPE_GUARD({ @@ -377,6 +376,4 @@ test(I2C_07_bus_reset_is_not_destructive) { } } -#endif // !HAL_PLATFORM_RTL872X - #endif // HAL_PLATFORM_FUELGAUGE_MAX17043 diff --git a/user/tests/wiring/no_fixture_ble/ble.cpp b/user/tests/wiring/no_fixture_ble/ble.cpp index 4daba353fd..f687afbba5 100644 --- a/user/tests/wiring/no_fixture_ble/ble.cpp +++ b/user/tests/wiring/no_fixture_ble/ble.cpp @@ -20,7 +20,7 @@ #if Wiring_BLE == 1 -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) // P2 doesn't support setting device address +#if !HAL_PLATFORM_RTL872X // P2 doesn't support setting device address test(BLE_01_Set_BLE_Device_Address) { int ret; BleAddress defaultAddr = BLE.address(); @@ -74,7 +74,7 @@ test(BLE_01_Set_BLE_Device_Address) { getAddr = BLE.address(); assertTrue(getAddr == defaultAddr); } -#endif // PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM +#endif // !HAL_PLATFORM_RTL872X test(BLE_02_Set_BLE_Device_Name) { int ret; @@ -118,7 +118,7 @@ test(BLE_02_Set_BLE_Device_Name) { assertTrue(getName == defaultName); } -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) // P2 doesn't support setting TX power +#if !HAL_PLATFORM_RTL872X // P2 doesn't support setting TX power test(BLE_03_Set_BLE_Tx_Power) { int ret; int8_t getTxPower; @@ -179,7 +179,7 @@ test(BLE_03_Set_BLE_Tx_Power) { assertEqual(ret, 0); assertEqual(getTxPower, 8); } -#endif // PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM +#endif // !HAL_PLATFORM_RTL872X test(BLE_04_Select_BLE_Antenna) { #if HAL_PLATFORM_RADIO_ANTENNA_EXTERNAL diff --git a/user/tests/wiring/no_fixture_long_running/pwm.cpp b/user/tests/wiring/no_fixture_long_running/pwm.cpp index 777c9e5118..6c43c86880 100644 --- a/user/tests/wiring/no_fixture_long_running/pwm.cpp +++ b/user/tests/wiring/no_fixture_long_running/pwm.cpp @@ -259,7 +259,7 @@ test(PWM_07_AnalogWriteWithFrequencyOnPinResultsInCorrectAnalogValue) { } // FIXME: P2 doesn't support pulse in for now -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X test(PWM_08_LowDCAnalogWriteOnPinResultsInCorrectPulseWidth) { for_all_pwm_pins([](hal_pin_t pin, const char* name) { out->printlnf("Pin: %s", name); @@ -725,4 +725,4 @@ test(PWM_12_CompherensiveResolutionFrequency) { assertMoreOrEqual(resolution, 15); }); } -#endif // (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#endif // !HAL_PLATFORM_RTL872X diff --git a/user/tests/wiring/no_fixture_long_running/servo.cpp b/user/tests/wiring/no_fixture_long_running/servo.cpp index 21072ade31..d18e7e5292 100644 --- a/user/tests/wiring/no_fixture_long_running/servo.cpp +++ b/user/tests/wiring/no_fixture_long_running/servo.cpp @@ -89,7 +89,7 @@ test(SERVO_04_WritePulseWidthOnPinResultsInCorrectMicroSeconds) { } // FIXME: P2 doesn't support pulseIn() -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X test(SERVO_05_DetachDoesntAffectAnotherServoUsingSameTimer) { const int pulseWidth = 2000; // Attach 1st servo @@ -115,4 +115,4 @@ test(SERVO_05_DetachDoesntAffectAnotherServoUsingSameTimer) { servo2.detach(); assertTrue(readPulseWidth > pulseWidth - 50 && readPulseWidth < pulseWidth + 50); } -#endif // PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM +#endif // !HAL_PLATFORM_RTL872X diff --git a/user/tests/wiring/no_fixture_long_running/ticks.cpp b/user/tests/wiring/no_fixture_long_running/ticks.cpp index d598752ff7..52e1a56382 100644 --- a/user/tests/wiring/no_fixture_long_running/ticks.cpp +++ b/user/tests/wiring/no_fixture_long_running/ticks.cpp @@ -6,7 +6,7 @@ #include #include "random.h" -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #ifdef AMEBAD_TODO #define __ARMV8MML_REV 0x0000U /*!< ARMV8MML Core Revision */ #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ @@ -26,7 +26,7 @@ #endif #include /* Use CMSE intrinsics */ #include "core_armv8mml.h" -#endif // PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM +#endif // HAL_PLATFORM_RTL872X namespace { diff --git a/user/tests/wiring/no_fixture_long_running/tone.cpp b/user/tests/wiring/no_fixture_long_running/tone.cpp index f9105ebe96..8f2e91eadd 100644 --- a/user/tests/wiring/no_fixture_long_running/tone.cpp +++ b/user/tests/wiring/no_fixture_long_running/tone.cpp @@ -27,7 +27,7 @@ #include "tone_hal.h" #include "unit-test/unit-test.h" -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X static const hal_pin_t pin = D1;//pin under test #elif PLATFORM_ID == PLATFORM_ESOMX static const hal_pin_t pin = A3;//pin under test diff --git a/user/tests/wiring/no_fixture_spi/spix.cpp b/user/tests/wiring/no_fixture_spi/spix.cpp index 8515879ef5..b148cd0ffe 100644 --- a/user/tests/wiring/no_fixture_spi/spix.cpp +++ b/user/tests/wiring/no_fixture_spi/spix.cpp @@ -141,7 +141,7 @@ test(SPIX_03_SPI_Begin_With_Mode) querySpiInfo(HAL_SPI_INTERFACE2, &info); assertTrue(info.enabled); assertEqual(info.mode, SPI_MODE_SLAVE); -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X assertEqual(info.ss_pin, D5); #else #error "Unknown platform!" @@ -279,7 +279,7 @@ test(SPIX_07_SPI1_Begin_With_Mode) SPI1.end(); // SPI1 can't work as slave on Tron -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X memset(&info, 0x00, sizeof(hal_spi_info_t)); SPI1.begin(SPI_MODE_SLAVE); querySpiInfo(HAL_SPI_INTERFACE2, &info); @@ -335,7 +335,7 @@ test(SPIX_08_SPI1_Begin_With_Master_Ss_Pin) } // SPI1 can't work as slave on Tron -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X test(SPIX_09_SPI1_Begin_With_Slave_Ss_Pin) { // Just in case @@ -374,7 +374,7 @@ test(SPIX_09_SPI1_Begin_With_Slave_Ss_Pin) assertFalse(info.enabled); SPI1.end(); } -#endif // (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#endif // !HAL_PLATFORM_RTL872X #endif // Wiring_SPI1 namespace { diff --git a/user/tests/wiring/sleep20/sleep20.cpp b/user/tests/wiring/sleep20/sleep20.cpp index abd5501a9e..e5dbc609f7 100644 --- a/user/tests/wiring/sleep20/sleep20.cpp +++ b/user/tests/wiring/sleep20/sleep20.cpp @@ -89,7 +89,7 @@ test(02_System_Sleep_Mode_Deep_Without_Wakeup) { } } -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X test(03_System_Sleep_With_Configuration_Object_Hibernate_Mode_Wakeup_By_D0) { if (phase == 0xbeef0003) { Serial.println(" >> Device enters hibernate mode."); @@ -209,9 +209,9 @@ test(07_System_Sleep_Mode_Deep_Wakeup_By_External_Rtc) { } } #endif // HAL_PLATFORM_EXTERNAL_RTC -#endif // PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM +#endif // !HAL_PLATFORM_RTL872X -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X test(08_System_Sleep_With_Configuration_Object_Hibernate_Mode_Wakeup_By_Wkp_Pin) { if (phase == 0xbeef0003) { Serial.println(" >> Device enters hibernate mode."); @@ -333,7 +333,7 @@ test(12_System_Sleep_With_Configuration_Object_Hibernate_Mode_Bypass_Network_Off assertLessOrEqual(exitTime - enterTime, SLEEP_DURATION_S + 1); } } -#endif // (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#endif // HAL_PLATFORM_RTL872X test(13_System_Sleep_With_Configuration_Object_Stop_Mode_Without_Wakeup) { SystemSleepConfiguration config; @@ -508,7 +508,7 @@ test(22_System_Sleep_With_Configuration_Object_Ultra_Low_Power_Mode_Wakeup_By_Rt assertEqual((int)result.wakeupReason(), (int)SystemSleepWakeupReason::BY_RTC); } -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X #if HAL_PLATFORM_BLE test(23_System_Sleep_With_Configuration_Object_Ultra_Low_Power_Mode_Wakeup_By_Ble) { @@ -725,7 +725,7 @@ test(31_System_Sleep_With_Configuration_Object_Ultra_Low_Power_Mode_Wakeup_By_Wi } #endif // HAL_PLATFORM_WIFI -#endif // (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#endif // !HAL_PLATFORM_RTL872X test(32_System_Sleep_With_Configuration_Object_Execution_Time_Prepare) { /* This test should only be run with threading disabled */ diff --git a/user/tests/wiring/spi_master_slave/spi_master/spi_master.cpp b/user/tests/wiring/spi_master_slave/spi_master/spi_master.cpp index a6091473e1..e46a431048 100644 --- a/user/tests/wiring/spi_master_slave/spi_master/spi_master.cpp +++ b/user/tests/wiring/spi_master_slave/spi_master/spi_master.cpp @@ -19,7 +19,7 @@ #endif // #ifndef USE_CS -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #if (USE_SPI == 0 || USE_SPI == 255) // default to SPI #define MY_SPI SPI @@ -87,7 +87,7 @@ #error "Unsupported platform" -#endif // #if PLATFORM_P2 +#endif // #if HAL_PLATFORM_RTL872X #if defined(_SPI) && (USE_CS != 255) diff --git a/user/tests/wiring/spi_master_slave/spi_slave/spi_slave.cpp b/user/tests/wiring/spi_master_slave/spi_slave/spi_slave.cpp index c96c0f3cbc..7ef5615e36 100644 --- a/user/tests/wiring/spi_master_slave/spi_slave/spi_slave.cpp +++ b/user/tests/wiring/spi_master_slave/spi_slave/spi_slave.cpp @@ -15,7 +15,7 @@ #error Define USE_CS #endif // #ifndef USE_CS -#if (PLATFORM_ID == PLATFORM_P2 || PLATFORM_ID == PLATFORM_TRACKERM) +#if HAL_PLATFORM_RTL872X #if (USE_SPI == 0 || USE_SPI == 255) // default to SPI #error "SPI not supported as slave for p2" @@ -81,7 +81,7 @@ #endif // #if (PLATFORM_ID == PLATFORM_ASOM) || (PLATFORM_ID == PLATFORM_BSOM) || (PLATFORM_ID == PLATFORM_B5SOM) -#endif // HAL_PLATFORM_NRF52840 +#endif // HAL_PLATFORM_RTL872X #if defined(_SPI) && (USE_CS != 255) #pragma message "Overriding default CS selection" diff --git a/wiring_globals/src/spark_wiring_gpio.cpp b/wiring_globals/src/spark_wiring_gpio.cpp index 8eadd26113..ad344adee2 100644 --- a/wiring_globals/src/spark_wiring_gpio.cpp +++ b/wiring_globals/src/spark_wiring_gpio.cpp @@ -194,7 +194,7 @@ int32_t digitalRead(hal_pin_t pin) */ int32_t analogRead(hal_pin_t pin) { -#if (PLATFORM_ID != PLATFORM_P2 && PLATFORM_ID != PLATFORM_TRACKERM) +#if !HAL_PLATFORM_RTL872X // Allow people to use 0-7 to define analog pins by checking to see if the values are too low. #if defined(FIRST_ANALOG_PIN) && FIRST_ANALOG_PIN > 0 if(pin < FIRST_ANALOG_PIN)