diff --git a/boards/Kconfig b/boards/Kconfig index 9e67ab0..7f002de 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -27,6 +27,14 @@ config HS_MOSFET_FAIL_SAFE_PROTECTION short and trip the fuse by switching the low-side MOSFET continuously on. This will prevent accidental overcharging of the battery. +# +# Temporary solution to support building with Zephyr 2.2 and 2.3 +# + +config LEGACY_DEVICETREE_MACROS + bool "Allow use of legacy devicetree macros (fix for Zephyr 2.2)" + default y + # # Visible (user-configurable) Kconfig symbols # diff --git a/boards/arm/mppt_1210_hus/Kconfig.defconfig b/boards/arm/mppt_1210_hus/Kconfig.defconfig index 0491004..4de9e29 100755 --- a/boards/arm/mppt_1210_hus/Kconfig.defconfig +++ b/boards/arm/mppt_1210_hus/Kconfig.defconfig @@ -12,6 +12,7 @@ config LIBRE_SOLAR_TYPE_ID if UART_CONSOLE config UART_2 + bool default y endif # UART_CONSOLE diff --git a/boards/arm/mppt_2420_hpx/Kconfig.defconfig b/boards/arm/mppt_2420_hpx/Kconfig.defconfig index 9a9bd42..176f004 100644 --- a/boards/arm/mppt_2420_hpx/Kconfig.defconfig +++ b/boards/arm/mppt_2420_hpx/Kconfig.defconfig @@ -12,6 +12,7 @@ config LIBRE_SOLAR_TYPE_ID if UART_CONSOLE config UART_1 + bool default y endif # UART_CONSOLE @@ -26,10 +27,12 @@ endif # I2C if PWM config PWM_STM32_3 + bool default y depends on PWM config PWM_STM32_8 + bool default y depends on PWM diff --git a/boards/arm/mppt_2420_lc/Kconfig.defconfig b/boards/arm/mppt_2420_lc/Kconfig.defconfig index d354d49..74dcf77 100755 --- a/boards/arm/mppt_2420_lc/Kconfig.defconfig +++ b/boards/arm/mppt_2420_lc/Kconfig.defconfig @@ -12,6 +12,7 @@ config LIBRE_SOLAR_TYPE_ID if UART_CONSOLE config UART_2 + bool default y endif # UART_CONSOLE diff --git a/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig b/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig index 4fe1927..ee6e4f6 100755 --- a/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig +++ b/boards/arm/mppt_2420_lc/mppt_2420_lc_defconfig @@ -35,7 +35,7 @@ CONFIG_I2C_1=y CONFIG_I2C_2=y CONFIG_CAN=y -CONFIG_CAN_1=y +#CONFIG_CAN_1=y CONFIG_EXT_THINGSET_CAN=y CONFIG_EEPROM=y diff --git a/boards/arm/pwm_2420_lus/Kconfig.defconfig b/boards/arm/pwm_2420_lus/Kconfig.defconfig index 0ad0411..8686e6d 100644 --- a/boards/arm/pwm_2420_lus/Kconfig.defconfig +++ b/boards/arm/pwm_2420_lus/Kconfig.defconfig @@ -12,6 +12,7 @@ config LIBRE_SOLAR_TYPE_ID if UART_CONSOLE config UART_2 + bool default y endif # UART_CONSOLE diff --git a/src/daq_driver.c b/src/daq_driver.c index 23decd0..dcfdab4 100644 --- a/src/daq_driver.c +++ b/src/daq_driver.c @@ -42,7 +42,7 @@ // Rank and sequence definitions for STM32G4 from adc_stm32.c Zephyr driver #define RANK(n) LL_ADC_REG_RANK_##n -static const u32_t table_rank[] = { +static const uint32_t table_rank[] = { RANK(1), RANK(2), RANK(3), @@ -62,7 +62,7 @@ static const u32_t table_rank[] = { }; #define SEQ_LEN(n) LL_ADC_REG_SEQ_SCAN_ENABLE_##n##RANKS -static const u32_t table_seq_len[] = { +static const uint32_t table_seq_len[] = { LL_ADC_REG_SEQ_SCAN_DISABLE, SEQ_LEN(2), SEQ_LEN(3), diff --git a/src/ext/can.cpp b/src/ext/can.cpp index 83ad7dd..996af15 100644 --- a/src/ext/can.cpp +++ b/src/ext/can.cpp @@ -140,7 +140,7 @@ void ThingSetCAN::process_asap() #endif } -void can_pub_isr(u32_t err_flags, void *arg) +void can_pub_isr(uint32_t err_flags, void *arg) { // Do nothing. Publication messages are fire and forget. } diff --git a/src/ext/serial.cpp b/src/ext/serial.cpp index 6568f0b..0cee98b 100644 --- a/src/ext/serial.cpp +++ b/src/ext/serial.cpp @@ -133,7 +133,7 @@ void ThingSetStream::process_asap() */ void ThingSetStream::process_input(void* user_data) { - u8_t c; + uint8_t c; DataStreamStruct *data_stream_ptr = (DataStreamStruct *)user_data; bool command_flag = *(data_stream_ptr->command_flag_ptr); char *buf_req = data_stream_ptr->buf_req_ptr; diff --git a/zephyr/prj.conf b/zephyr/prj.conf index a253218..d09157f 100644 --- a/zephyr/prj.conf +++ b/zephyr/prj.conf @@ -6,9 +6,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_GPIO=y CONFIG_SERIAL=y -CONFIG_UART_1=y CONFIG_I2C=y -CONFIG_I2C_1=y # disable log by default to save memory for STM32F0 with little RAM CONFIG_LOG=y @@ -36,3 +34,5 @@ CONFIG_EXT_THINGSET_SERIAL=y CONFIG_REBOOT=y CONFIG_WATCHDOG=y + +CONFIG_LEGACY_DEVICETREE_MACROS=y