diff --git a/app/prj.conf b/app/prj.conf index 90f701e..8dfeace 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -7,6 +7,7 @@ CONFIG_CPLUSPLUS=y CONFIG_LIB_CPLUSPLUS=y CONFIG_NEWLIB_LIBC=y +CONFIG_NEWLIB_LIBC_NANO=y CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_WATCHDOG=y diff --git a/app/src/bat_charger.cpp b/app/src/bat_charger.cpp index 60b6747..118c122 100644 --- a/app/src/bat_charger.cpp +++ b/app/src/bat_charger.cpp @@ -6,9 +6,9 @@ #include "bat_charger.h" -#include +#include -#include +#include LOG_MODULE_REGISTER(bat_charger, CONFIG_BAT_LOG_LEVEL); #include diff --git a/app/src/board.h b/app/src/board.h index 5bce977..2bf2e39 100644 --- a/app/src/board.h +++ b/app/src/board.h @@ -13,7 +13,7 @@ * @brief Defines for conditional compiling based on existing board features */ -#include +#include #define BOARD_HAS_DCDC DT_HAS_COMPAT_STATUS_OKAY(half_bridge) #define BOARD_HAS_PWM_PORT DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), pwm_switch)) diff --git a/app/src/daq.cpp b/app/src/daq.cpp index 399127f..1c4f213 100644 --- a/app/src/daq.cpp +++ b/app/src/daq.cpp @@ -6,9 +6,9 @@ #include "daq.h" -#include +#include -#include +#include LOG_MODULE_REGISTER(daq, CONFIG_DAQ_LOG_LEVEL); #include diff --git a/app/src/daq.h b/app/src/daq.h index 9536f79..e589815 100644 --- a/app/src/daq.h +++ b/app/src/daq.h @@ -24,7 +24,7 @@ extern "C" { #endif -#include +#include #include diff --git a/app/src/daq_driver.c b/app/src/daq_driver.c index 7d6aa4c..7343269 100644 --- a/app/src/daq_driver.c +++ b/app/src/daq_driver.c @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -215,14 +215,15 @@ static void adc_init(ADC_TypeDef *adc) LL_ADC_Enable(adc); } -#define V_HIGH_ENABLE_GPIO DT_CHILD(DT_PATH(adc_inputs), v_high) +#define V_HIGH_ENABLE_NODE DT_CHILD(DT_PATH(adc_inputs), v_high) static void adc_setup() { -#if DT_NODE_EXISTS(DT_PROP(V_HIGH_ENABLE_GPIO, enable_gpios)) - const struct device *dev = device_get_binding(DT_GPIO_LABEL(V_HIGH_ENABLE_GPIO, enable_gpios)); - gpio_pin_configure(dev, DT_GPIO_PIN(V_HIGH_ENABLE_GPIO, enable_gpios), - DT_GPIO_FLAGS(V_HIGH_ENABLE_GPIO, enable_gpios) | GPIO_OUTPUT_ACTIVE); +#if DT_NODE_EXISTS(DT_PROP(V_HIGH_ENABLE_NODE, enable_gpios)) + const struct gpio_dt_spec v_high_enable = GPIO_DT_SPEC_GET(V_HIGH_ENABLE_NODE, enable_gpios); + if (device_is_ready(v_high_enable.port)) { + gpio_pin_configure_dt(&v_high_enable, GPIO_OUTPUT_ACTIVE); + } #endif adc_init(ADC1); diff --git a/app/src/data_objects.cpp b/app/src/data_objects.cpp index bf1e790..e8259dc 100644 --- a/app/src/data_objects.cpp +++ b/app/src/data_objects.cpp @@ -7,10 +7,10 @@ #include "data_objects.h" #include -#include +#include -#include -#include +#include +#include #ifdef CONFIG_SOC_FAMILY_STM32 #include diff --git a/app/src/data_storage.cpp b/app/src/data_storage.cpp index 4a37bfb..46e79da 100644 --- a/app/src/data_storage.cpp +++ b/app/src/data_storage.cpp @@ -6,7 +6,7 @@ #include "data_storage.h" -#include +#include #include "data_objects.h" #include "helper.h" @@ -17,8 +17,8 @@ #ifdef CONFIG_SOC_FAMILY_STM32 -#include #include +#include LOG_MODULE_REGISTER(nvs, CONFIG_DATA_STORAGE_LOG_LEVEL); @@ -57,7 +57,7 @@ uint32_t _calc_crc(const uint8_t *buf, size_t len) #ifdef CONFIG_EEPROM -#include +#include /* * EEPROM header bytes: @@ -69,11 +69,16 @@ uint32_t _calc_crc(const uint8_t *buf, size_t len) */ #define EEPROM_HEADER_SIZE 8 +static const struct device *eeprom_dev = DEVICE_DT_GET(DT_NODELABEL(eeprom)); + void data_storage_read() { int err; - const struct device *eeprom_dev = device_get_binding("EEPROM_0"); + if (!device_is_ready(eeprom_dev)) { + LOG_ERR("EEPROM device not ready"); + return; + } uint8_t buf_header[EEPROM_HEADER_SIZE] = {}; err = eeprom_read(eeprom_dev, 0, buf_header, EEPROM_HEADER_SIZE); @@ -116,7 +121,10 @@ void data_storage_write() { int err; - const struct device *eeprom_dev = device_get_binding("EEPROM_0"); + if (!device_is_ready(eeprom_dev)) { + LOG_ERR("EEPROM device not ready"); + return; + } k_mutex_lock(&data_buf_lock, K_FOREVER); @@ -150,9 +158,9 @@ void data_storage_write() #elif defined(CONFIG_NVS) -#include -#include -#include +#include +#include +#include /* * NVS header bytes: @@ -162,7 +170,7 @@ void data_storage_write() */ #define NVS_HEADER_SIZE 2 -#define STORAGE_NODE_LABEL storage +#define NVS_PARTITION storage_partition #define THINGSET_DATA_ID 1 @@ -174,19 +182,19 @@ static int data_storage_init() int err; struct flash_pages_info page_info; - fs.flash_device = FLASH_AREA_DEVICE(STORAGE_NODE_LABEL); + fs.flash_device = FIXED_PARTITION_DEVICE(NVS_PARTITION); if (!device_is_ready(fs.flash_device)) { LOG_ERR("Flash device not ready"); return -ENODEV; } - fs.offset = FLASH_AREA_OFFSET(STORAGE_NODE_LABEL); + fs.offset = FIXED_PARTITION_OFFSET(NVS_PARTITION); err = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &page_info); if (err) { LOG_ERR("Unable to get flash page info"); return err; } fs.sector_size = page_info.size; - fs.sector_count = FLASH_AREA_SIZE(STORAGE_NODE_LABEL) / page_info.size; + fs.sector_count = FIXED_PARTITION_SIZE(NVS_PARTITION) / page_info.size; err = nvs_mount(&fs); if (err) { @@ -251,7 +259,10 @@ void data_storage_write() else { int ret = nvs_write(&fs, THINGSET_DATA_ID, &buf, len + NVS_HEADER_SIZE); if (ret == len + NVS_HEADER_SIZE) { - LOG_INF("NVS data successfully stored"); + LOG_DBG("NVS data successfully stored"); + } + else if (ret == 0) { + LOG_DBG("NVS data unchanged"); } else { LOG_ERR("NVS write error %d", ret); diff --git a/app/src/dcdc.cpp b/app/src/dcdc.cpp index 33c5798..1444436 100644 --- a/app/src/dcdc.cpp +++ b/app/src/dcdc.cpp @@ -6,10 +6,10 @@ #include "dcdc.h" -#include +#include -#include -#include +#include +#include #include // for fabs function #include diff --git a/app/src/device_status.cpp b/app/src/device_status.cpp index b08ed47..dd008c0 100644 --- a/app/src/device_status.cpp +++ b/app/src/device_status.cpp @@ -6,7 +6,7 @@ #include "device_status.h" -#include +#include #include // for fabs function #include diff --git a/app/src/ext/can.cpp b/app/src/ext/can.cpp index bbef0b5..641c6ca 100644 --- a/app/src/ext/can.cpp +++ b/app/src/ext/can.cpp @@ -6,17 +6,17 @@ #if CONFIG_THINGSET_CAN -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef CONFIG_ISOTP -#include +#include #endif -#include +#include LOG_MODULE_REGISTER(ext_can, CONFIG_CAN_LOG_LEVEL); #include "bat_charger.h" @@ -144,7 +144,7 @@ K_THREAD_DEFINE(can_isotp, RX_THREAD_STACK_SIZE, can_isotp_thread, NULL, NULL, N CAN_MSGQ_DEFINE(sub_msgq, 10); -const struct zcan_filter ctrl_filter = { +const struct can_filter ctrl_filter = { .id = TS_CAN_BASE_CONTROL, .rtr = CAN_DATAFRAME, .id_type = CAN_EXTENDED_IDENTIFIER, @@ -159,7 +159,7 @@ void can_pub_isr(const struct device *dev, int error, void *user_data) void can_pub_send(uint32_t can_id, uint8_t can_data[8], uint8_t data_len) { - struct zcan_frame frame = { 0 }; + struct can_frame frame = { 0 }; frame.id_type = CAN_EXTENDED_IDENTIFIER; frame.rtr = CAN_DATAFRAME; frame.id = can_id; @@ -180,11 +180,7 @@ void can_pubsub_thread() unsigned int can_id; uint8_t can_data[8]; - struct zcan_frame rx_frame; - - const struct device *can_en_dev = device_get_binding(DT_GPIO_LABEL(CAN_EN_GPIO, gpios)); - gpio_pin_configure(can_en_dev, DT_GPIO_PIN(CAN_EN_GPIO, gpios), - DT_GPIO_FLAGS(CAN_EN_GPIO, gpios) | GPIO_OUTPUT_ACTIVE); + struct can_frame rx_frame; if (!device_is_ready(can_dev)) { return; diff --git a/app/src/ext/oled.cpp b/app/src/ext/oled.cpp index 969e87c..ce05427 100644 --- a/app/src/ext/oled.cpp +++ b/app/src/ext/oled.cpp @@ -9,9 +9,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "oled_ssd1306.h" diff --git a/app/src/ext/serial.cpp b/app/src/ext/serial.cpp index 9f8afdc..46afb2f 100644 --- a/app/src/ext/serial.cpp +++ b/app/src/ext/serial.cpp @@ -9,10 +9,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "data_objects.h" #include "hardware.h" diff --git a/app/src/half_bridge.c b/app/src/half_bridge.c index e82fe46..a266c44 100644 --- a/app/src/half_bridge.c +++ b/app/src/half_bridge.c @@ -8,7 +8,7 @@ #include "half_bridge.h" -#include +#include #include @@ -16,9 +16,9 @@ #include "mcu.h" #ifdef CONFIG_SOC_FAMILY_STM32 -#include #include #include +#include #endif #if BOARD_HAS_DCDC diff --git a/app/src/hardware.cpp b/app/src/hardware.cpp index a97ec64..13aa47b 100644 --- a/app/src/hardware.cpp +++ b/app/src/hardware.cpp @@ -16,11 +16,11 @@ #ifndef UNIT_TEST #if DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), boot0)) -#define BOOT0_GPIO DT_CHILD(DT_PATH(outputs), boot0) +#define BOOT0_NODE DT_CHILD(DT_PATH(outputs), boot0) #endif -#include -#include +#include +#include LOG_MODULE_REGISTER(hardware, CONFIG_HW_LOG_LEVEL); @@ -28,12 +28,12 @@ void start_stm32_bootloader() { #if DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), boot0)) // pin is connected to BOOT0 via resistor and capacitor - const struct device *dev = device_get_binding(DT_GPIO_LABEL(BOOT0_GPIO, gpios)); - gpio_pin_configure(dev, DT_GPIO_PIN(BOOT0_GPIO, gpios), - DT_GPIO_FLAGS(BOOT0_GPIO, gpios) | GPIO_OUTPUT_ACTIVE); - - k_sleep(K_MSEC(100)); // wait for capacitor at BOOT0 pin to charge up - reset_device(); + const struct gpio_dt_spec boot0 = GPIO_DT_SPEC_GET(BOOT0_NODE, gpios); + if (device_is_ready(boot0.port)) { + gpio_pin_configure_dt(&boot0, GPIO_OUTPUT_ACTIVE); + k_sleep(K_MSEC(100)); // wait for capacitor at BOOT0 pin to charge up + reset_device(); + } #elif defined(CONFIG_SOC_SERIES_STM32G4X) if ((FLASH->CR & FLASH_CR_OPTLOCK) != 0U) { /* Authorizes the Option Byte register programming */ diff --git a/app/src/helper.h b/app/src/helper.h index fd6dad2..3d96a16 100644 --- a/app/src/helper.h +++ b/app/src/helper.h @@ -35,11 +35,11 @@ #else -#include +#include #endif /* VSCODE_INTELLISENSE_HACK */ -#include +#include #ifdef __cplusplus extern "C" { diff --git a/app/src/leds.cpp b/app/src/leds.cpp index 451f486..a5aa61a 100644 --- a/app/src/leds.cpp +++ b/app/src/leds.cpp @@ -6,9 +6,11 @@ #include "leds.h" -#include -#include -#include +#include +#include +#include + +#include #include "hardware.h" @@ -65,57 +67,19 @@ static const int led_pin_states[NUM_LEDS][NUM_LED_PINS] = { DT_FOREACH_CHILD(DT_ /* * GPIO pin numbers (for up to 5 LED pins) */ -static const gpio_pin_t led_pins[] = { - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 0, pin), +static const gpio_dt_spec led_gpios[] = { + GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(leds), gpios, 0), #if NUM_LED_PINS >= 2 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 1, pin), + GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(leds), gpios, 1), #endif #if NUM_LED_PINS >= 3 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 2, pin), + GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(leds), gpios, 2), #endif #if NUM_LED_PINS >= 4 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 3, pin), + GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(leds), gpios, 3), #endif #if NUM_LED_PINS >= 5 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 4, pin), -#endif -}; - -/* - * GPIO port labels (for up to 5 LED pins) - */ -static const char *const led_ports[] = { - DT_PROP_BY_PHANDLE_IDX(DT_PATH(leds), gpios, 0, label), -#if NUM_LED_PINS >= 2 - DT_PROP_BY_PHANDLE_IDX(DT_PATH(leds), gpios, 1, label), -#endif -#if NUM_LED_PINS >= 3 - DT_PROP_BY_PHANDLE_IDX(DT_PATH(leds), gpios, 2, label), -#endif -#if NUM_LED_PINS >= 4 - DT_PROP_BY_PHANDLE_IDX(DT_PATH(leds), gpios, 3, label), -#endif -#if NUM_LED_PINS >= 5 - DT_PROP_BY_PHANDLE_IDX(DT_PATH(leds), gpios, 4, label), -#endif -}; - -/* - * GPIO pin flags (for up to 5 LED pins) - */ -static const gpio_flags_t led_flags[] = { - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 0, flags), -#if NUM_LED_PINS >= 2 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 1, flags), -#endif -#if NUM_LED_PINS >= 3 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 2, flags), -#endif -#if NUM_LED_PINS >= 4 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 3, flags), -#endif -#if NUM_LED_PINS >= 5 - DT_PHA_BY_IDX(DT_PATH(leds), gpios, 4, flags), + GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(leds), gpios, 4), #endif }; @@ -132,12 +96,14 @@ void leds_update_thread() unsigned int led_count = 0; int flicker_count = 0; bool flicker_state = true; - const struct device *led_devs[NUM_LED_PINS]; int wdt_channel = task_wdt_add(1000, task_wdt_callback, (void *)k_current_get()); for (int pin = 0; pin < NUM_LED_PINS; pin++) { - led_devs[pin] = device_get_binding(led_ports[pin]); + if (!device_is_ready(led_gpios[pin].port)) { + printf("LED %d not ready\n", pin); + return; + } } leds_init(true); @@ -164,17 +130,13 @@ void leds_update_thread() for (unsigned int pin_number = 0; pin_number < NUM_LED_PINS; pin_number++) { switch (led_pin_states[led_count][pin_number]) { case PIN_HIGH: - gpio_pin_configure(led_devs[pin_number], led_pins[pin_number], - led_flags[pin_number] | GPIO_OUTPUT); - gpio_pin_set(led_devs[pin_number], led_pins[pin_number], 1); + gpio_pin_configure_dt(&led_gpios[pin_number], GPIO_OUTPUT_ACTIVE); break; case PIN_LOW: - gpio_pin_configure(led_devs[pin_number], led_pins[pin_number], - led_flags[pin_number] | GPIO_OUTPUT); - gpio_pin_set(led_devs[pin_number], led_pins[pin_number], 0); + gpio_pin_configure_dt(&led_gpios[pin_number], GPIO_OUTPUT_INACTIVE); break; case PIN_FLOAT: - gpio_pin_configure(led_devs[pin_number], led_pins[pin_number], GPIO_INPUT); + gpio_pin_configure_dt(&led_gpios[pin_number], GPIO_INPUT); break; } } @@ -182,7 +144,7 @@ void leds_update_thread() else { // all pins floating for (unsigned int pin_number = 0; pin_number < NUM_LED_PINS; pin_number++) { - gpio_pin_configure(led_devs[pin_number], led_pins[pin_number], GPIO_INPUT); + gpio_pin_configure_dt(&led_gpios[pin_number], GPIO_INPUT); } } diff --git a/app/src/leds.h b/app/src/leds.h index b49a9af..e65dd1a 100644 --- a/app/src/leds.h +++ b/app/src/leds.h @@ -21,7 +21,7 @@ extern "C" { #endif -#include +#include /* * Find out if LED was specified in board devicetree file diff --git a/app/src/load.cpp b/app/src/load.cpp index 76820f0..19c3672 100644 --- a/app/src/load.cpp +++ b/app/src/load.cpp @@ -7,7 +7,7 @@ #include "load.h" #include "board.h" -#include +#include #if BOARD_HAS_LOAD_OUTPUT || UNIT_TEST diff --git a/app/src/load_driver.c b/app/src/load_driver.c index b4389af..36bcfd3 100644 --- a/app/src/load_driver.c +++ b/app/src/load_driver.c @@ -8,10 +8,10 @@ #ifdef CONFIG_SOC_FAMILY_STM32 -#include -#include -#include -#include +#include +#include +#include +#include #include "board.h" #include "hardware.h" @@ -21,14 +21,16 @@ #include #include +#include + #if BOARD_HAS_LOAD_OUTPUT -#define LOAD_GPIO DT_CHILD(DT_PATH(outputs), load) -static const struct device *dev_load; +#define LOAD_NODE DT_CHILD(DT_PATH(outputs), load) +static const struct gpio_dt_spec load_switch = GPIO_DT_SPEC_GET(LOAD_NODE, gpios); #endif #if BOARD_HAS_USB_OUTPUT -#define USB_GPIO DT_CHILD(DT_PATH(outputs), usb_pwr) -static const struct device *dev_usb; +#define USB_NODE DT_CHILD(DT_PATH(outputs), usb_pwr) +static const struct gpio_dt_spec usb_switch = GPIO_DT_SPEC_GET(USB_NODE, gpios); #endif // short circuit detection comparator only present in PWM 2420 LUS board so far @@ -145,17 +147,20 @@ void load_out_set(bool status) #endif #if BOARD_HAS_LOAD_OUTPUT - gpio_pin_configure(dev_load, DT_GPIO_PIN(LOAD_GPIO, gpios), - DT_GPIO_FLAGS(LOAD_GPIO, gpios) | GPIO_OUTPUT_INACTIVE); + if (!device_is_ready(load_switch.port)) { + printf("Load switch GPIO not ready\n"); + return; + } + gpio_pin_configure_dt(&load_switch, GPIO_OUTPUT_INACTIVE); if (status == true) { #ifdef CONFIG_BOARD_PWM_2420_LUS lptim_init(); #else - gpio_pin_set(dev_load, DT_GPIO_PIN(LOAD_GPIO, gpios), 1); + gpio_pin_set_dt(&load_switch, 1); #endif } else { - gpio_pin_set(dev_load, DT_GPIO_PIN(LOAD_GPIO, gpios), 0); + gpio_pin_set_dt(&load_switch, 0); } #endif } @@ -163,17 +168,20 @@ void load_out_set(bool status) void usb_out_set(bool status) { #if BOARD_HAS_USB_OUTPUT - gpio_pin_configure(dev_usb, DT_GPIO_PIN(USB_GPIO, gpios), - DT_GPIO_FLAGS(USB_GPIO, gpios) | GPIO_OUTPUT_INACTIVE); + if (!device_is_ready(usb_switch.port)) { + printf("USB switch GPIO not ready\n"); + return; + } + gpio_pin_configure_dt(&usb_switch, GPIO_OUTPUT_INACTIVE); if (status == true) { - gpio_pin_set(dev_usb, DT_GPIO_PIN(USB_GPIO, gpios), 1); + gpio_pin_set_dt(&usb_switch, 1); #if DT_PROP(DT_CHILD(DT_PATH(outputs), usb_pwr), latching_pgood) k_sleep(K_MSEC(50)); - gpio_pin_configure(dev_usb, DT_GPIO_PIN(USB_GPIO, gpios), GPIO_INPUT); + gpio_pin_configure_dt(&usb_switch, GPIO_INPUT); #endif } else { - gpio_pin_set(dev_usb, DT_GPIO_PIN(USB_GPIO, gpios), 0); + gpio_pin_set_dt(&usb_switch, 0); } #endif } @@ -198,10 +206,6 @@ void load_cp_enable() void load_out_init() { -#if BOARD_HAS_LOAD_OUTPUT - dev_load = device_get_binding(DT_GPIO_LABEL(LOAD_GPIO, gpios)); -#endif - // analog comparator to detect short circuits and trigger immediate load switch-off #ifdef CONFIG_BOARD_PWM_2420_LUS short_circuit_comp_init(); @@ -215,15 +219,13 @@ void load_out_init() void usb_out_init() { -#if BOARD_HAS_USB_OUTPUT - dev_usb = device_get_binding(DT_GPIO_LABEL(USB_GPIO, gpios)); -#endif + // nothing to do } bool pgood_check() { #if BOARD_HAS_USB_OUTPUT - return gpio_pin_get(dev_usb, DT_GPIO_PIN(USB_GPIO, gpios)); + return gpio_pin_get_dt(&usb_switch); #else return false; #endif diff --git a/app/src/main.cpp b/app/src/main.cpp index 8d6bccc..cfc8a8a 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -6,11 +6,11 @@ #ifndef UNIT_TEST -#include -#include #include -#include -#include +#include +#include +#include +#include #include "helper.h" #include "setup.h" @@ -28,13 +28,13 @@ #include "load.h" // load and USB output management #include "pwm_switch.h" // PWM charge controller -void main(void) +int main(void) { printf("Hardware: Libre Solar %s (%s)\n", DT_PROP(DT_PATH(pcb), type), DT_PROP(DT_PATH(pcb), version_str)); printf("Firmware: %s\n", FIRMWARE_VERSION_ID); - task_wdt_init(device_get_binding(DT_LABEL(DT_NODELABEL(iwdg)))); + task_wdt_init(DEVICE_DT_GET_OR_NULL(DT_NODELABEL(iwdg))); setup(); diff --git a/app/src/pwm_switch.cpp b/app/src/pwm_switch.cpp index 8ca67c1..c3a9e4b 100644 --- a/app/src/pwm_switch.cpp +++ b/app/src/pwm_switch.cpp @@ -6,7 +6,7 @@ #include "pwm_switch.h" -#include +#include #include #include diff --git a/app/src/pwm_switch_driver.c b/app/src/pwm_switch_driver.c index 94ea468..fba3310 100644 --- a/app/src/pwm_switch_driver.c +++ b/app/src/pwm_switch_driver.c @@ -6,7 +6,7 @@ #include "pwm_switch.h" -#include +#include #include #include @@ -24,8 +24,8 @@ #include #include -#include #include +#include // all PWM charge controllers use TIM3 at the moment static TIM_TypeDef *tim = TIM3; diff --git a/app/src/setup.cpp b/app/src/setup.cpp index 2bf9eca..7c60ad1 100644 --- a/app/src/setup.cpp +++ b/app/src/setup.cpp @@ -9,7 +9,7 @@ * @brief Setup of ports and other essential charge controller objects */ -#include +#include #include "thingset.h" // handles access to internal data via communication interfaces @@ -85,7 +85,7 @@ uint32_t timestamp; #ifndef UNIT_TEST #include -#include +#include static inline void timestamp_inc(struct k_timer *timer_id) { diff --git a/app/src/setup.h b/app/src/setup.h index bedf5ef..d68c4e9 100644 --- a/app/src/setup.h +++ b/app/src/setup.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include diff --git a/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts b/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts index f5b6eb1..f30577b 100644 --- a/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts +++ b/boards/arm/mppt_2420_hpx/mppt_2420_hpx.dts @@ -265,11 +265,11 @@ pinctrl-names = "default"; status = "okay"; clock-frequency = ; - eeprom@50 { + + eeprom: eeprom@50 { // Microchip 24AA32A compatible = "atmel,at24"; reg = <0x50>; - label = "EEPROM_0"; size = <32768>; pagesize = <32>; address-width = <16>; diff --git a/boards/arm/mppt_2420_lc/mppt_2420_lc.dts b/boards/arm/mppt_2420_lc/mppt_2420_lc.dts index a15f7eb..a64a844 100644 --- a/boards/arm/mppt_2420_lc/mppt_2420_lc.dts +++ b/boards/arm/mppt_2420_lc/mppt_2420_lc.dts @@ -197,11 +197,11 @@ pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; pinctrl-names = "default"; clock-frequency = ; - eeprom@50 { + + eeprom: eeprom@50 { // Microchip 24AA32A compatible = "atmel,at24"; reg = <0x50>; - label = "EEPROM_0"; size = <32768>; pagesize = <32>; // 24AA01: 8 bytes address-width = <16>; // 24AA01: 8 bit diff --git a/boards/arm/mppt_2420_rc/mppt_2420_rc.dts b/boards/arm/mppt_2420_rc/mppt_2420_rc.dts index 02c44f7..281e9ba 100644 --- a/boards/arm/mppt_2420_rc/mppt_2420_rc.dts +++ b/boards/arm/mppt_2420_rc/mppt_2420_rc.dts @@ -206,11 +206,11 @@ pinctrl-0 = <&i2c1_scl_pa15 &i2c1_sda_pb7>; pinctrl-names = "default"; clock-frequency = ; - eeprom@50 { + + eeprom: eeprom@50 { // Microchip 24AA32A compatible = "atmel,at24"; reg = <0x50>; - label = "EEPROM_0"; size = <32768>; pagesize = <32>; address-width = <16>; diff --git a/dts/bindings/zephyr,dummy-pwm.yaml b/dts/bindings/zephyr,dummy-pwm.yaml index f5fefc6..08336d0 100644 --- a/dts/bindings/zephyr,dummy-pwm.yaml +++ b/dts/bindings/zephyr,dummy-pwm.yaml @@ -8,9 +8,6 @@ compatible: "zephyr,dummy-pwm" include: [pwm-controller.yaml, base.yaml] properties: - label: - required: true - "#pwm-cells": const: 3 diff --git a/tests/boards/native_posix.overlay b/tests/boards/native_posix.overlay index 1f33553..dc85731 100644 --- a/tests/boards/native_posix.overlay +++ b/tests/boards/native_posix.overlay @@ -149,7 +149,6 @@ pwm3: pwm3 { compatible = "zephyr,dummy-pwm"; - label = "PWM_3"; #pwm-cells = <3>; }; }; diff --git a/tests/src/main.cpp b/tests/src/main.cpp index 4b3ddff..9e0b651 100644 --- a/tests/src/main.cpp +++ b/tests/src/main.cpp @@ -7,8 +7,8 @@ #include "unity.h" #include -#include -#include +#include +#include #ifdef CONFIG_ARCH_POSIX #include "posix_board_if.h" diff --git a/west.yml b/west.yml index 35cef67..b20e065 100644 --- a/west.yml +++ b/west.yml @@ -10,8 +10,8 @@ manifest: url-base: https://github.com/ThrowTheSwitch projects: - name: zephyr - remote: zephyrproject - revision: v3.1-branch + remote: libresolar + revision: v3.2-branch import: name-allowlist: - cmsis @@ -19,11 +19,11 @@ manifest: - hal_stm32 - name: oled-display-library remote: libresolar - revision: cc3033c0daace8cb50ab0e6406a9498cc81cdb39 + revision: 523b26c103de56714fcda655702d600870a671bc path: modules/oled-display - name: thingset-device-library remote: thingset - revision: 5c2b562d77cd44969c822bbd8c37cd7394d5ca58 + revision: 1c4ca10b12620b1a70bbbcea6b2d4724289b9678 path: modules/thingset - name: unity remote: throwtheswitch