Skip to content

Commit

Permalink
cpu/esp8266: fixes for compilation with GCC 12.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maribu committed Oct 12, 2022
1 parent 2d41bc2 commit ab1527e
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 366 deletions.
7 changes: 7 additions & 0 deletions cpu/esp8266/include/sys/sched.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* in the xtensa-esp8266-elf toolchain in the docker container
* "sys/types.h" includes "sys/sched.h", which in turn results in conflicts with
* RIOT's scheduler. This file is an ugly workaround to fix the issues */

struct sched_param {
int this_is_just_a_mock_type_for_api_compatibility;
};
336 changes: 0 additions & 336 deletions cpu/esp8266/include/sys/types.h

This file was deleted.

2 changes: 2 additions & 0 deletions cpu/esp8266/periph/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)

case GPIO_OD_PU: iomux_conf |= IOMUX_PIN_PULLUP;
iomux_conf |= IOMUX_PIN_PULLUP_SLEEP;
/* falls through */
case GPIO_OD: iomux_conf |= IOMUX_PIN_OUTPUT_ENABLE;
iomux_conf |= IOMUX_PIN_OUTPUT_ENABLE_SLEEP;
GPIO.CONF[pin] |= GPIO_CONF_OPEN_DRAIN;
Expand All @@ -158,6 +159,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)

case GPIO_IN_PU: iomux_conf |= IOMUX_PIN_PULLUP;
iomux_conf |= IOMUX_PIN_PULLUP_SLEEP;
/* falls through */
case GPIO_IN: GPIO.CONF[pin] |= GPIO_CONF_OPEN_DRAIN;
GPIO.ENABLE_OUT_CLEAR = BIT(pin);
break;
Expand Down
4 changes: 2 additions & 2 deletions cpu/esp8266/periph/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

void pm_set_lowest(void)
{
DEBUG("%s enter to sleep @%u\n", __func__, system_get_time());
DEBUG("%s enter to sleep @%" PRIu32 "\n", __func__, system_get_time());

/* reset system watchdog timer */
system_wdt_feed();
Expand All @@ -36,7 +36,7 @@ void pm_set_lowest(void)
__asm__ volatile ("waiti 0");
#endif

DEBUG("%s exit from sleep @%u\n", __func__, system_get_time());
DEBUG("%s exit from sleep @%" PRIu32 "\n", __func__, system_get_time());

/* reset system watchdog timer */
system_wdt_feed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ void *osi_task_top_sp(void)
return active_thread ? active_thread->sp : 0;
}

static int32_t _nvs_open(const char *name, uint32_t mode, uint32_t *handle)
{
return nvs_open(name, mode, handle);
}

const wifi_osi_funcs_t s_wifi_osi_funcs = {
.version = ESP_WIFI_OS_ADAPTER_VERSION,

Expand Down Expand Up @@ -461,7 +466,7 @@ const wifi_osi_funcs_t s_wifi_osi_funcs = {
.nvs_get_u8 = nvs_get_u8,
.nvs_set_u16 = nvs_set_u16,
.nvs_get_u16 = nvs_get_u16,
.nvs_open = nvs_open,
.nvs_open = _nvs_open,
.nvs_close = nvs_close,
.nvs_commit = nvs_commit,
.nvs_set_blob = nvs_set_blob,
Expand Down
Loading

0 comments on commit ab1527e

Please sign in to comment.