Skip to content

Commit

Permalink
Merge branch 'master' into rfc7217
Browse files Browse the repository at this point in the history
  • Loading branch information
xnumad authored Feb 22, 2024
2 parents 1806101 + d83ec63 commit e3d432e
Show file tree
Hide file tree
Showing 112 changed files with 1,215 additions and 521 deletions.
10 changes: 2 additions & 8 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ ifneq ($(RIOT_CI_BUILD),1)
ifneq (iotlab,$(PROGRAMMER))
ifneq (,$(PROGRAMMERS_SUPPORTED))
ifeq (,$(filter $(PROGRAMMER),$(PROGRAMMERS_SUPPORTED)))
$(info '$(PROGRAMMER)' programmer is not supported by this board. \
$(warning '$(PROGRAMMER)' programmer is not supported by this board. \
Supported programmers: '$(PROGRAMMERS_SUPPORTED)')
endif
endif
Expand Down Expand Up @@ -523,10 +523,6 @@ include $(RIOTMAKE)/ubsan.inc.mk
# For more information, see http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
export CCACHE_CPP2=yes

ifeq ($(strip $(MCU)),)
MCU = $(CPU)
endif

# set some settings useful for continuous integration builds
ifeq ($(RIOT_CI_BUILD),1)
RIOT_VERSION ?= buildtest
Expand All @@ -548,11 +544,9 @@ endif
# if you want to publish the board into the sources as an uppercase #define
BOARDDEF = $(call uppercase_and_underscore,$(BOARD))
CPUDEF = $(call uppercase_and_underscore,$(CPU))
MCUDEF = $(call uppercase_and_underscore,$(MCU))
CFLAGS += -DRIOT_APPLICATION=\"$(APPLICATION)\"
CFLAGS += -DBOARD_$(BOARDDEF)=\"$(BOARD)\" -DRIOT_BOARD=BOARD_$(BOARDDEF)
CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
CFLAGS += -DMCU_$(MCUDEF)=\"$(MCU)\" -DRIOT_MCU=MCU_$(MCUDEF)

# Feature test default CFLAGS and LINKFLAGS for the set compiled.
include $(RIOTMAKE)/cflags.inc.mk
Expand Down Expand Up @@ -812,7 +806,7 @@ endif
$(call check_cmd,$(CC),Compiler)

..build-message: $(if $(SHOULD_RUN_KCONFIG), check-kconfig-errors)
@$(COLOR_ECHO) '$(COLOR_GREEN)Building application "$(APPLICATION)" for "$(BOARD)" with MCU "$(MCU)".$(COLOR_RESET)'
@$(COLOR_ECHO) '$(COLOR_GREEN)Building application "$(APPLICATION)" for "$(BOARD)" with CPU "$(CPU)".$(COLOR_RESET)'
@$(COLOR_ECHO)

# The `clean` needs to be serialized before everything else.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ indirect business models around the free open-source software platform
provided by RIOT, e.g. it is possible to link closed-source code with the
LGPL code.

## FEATURES
## Features

RIOT provides features including, but not limited to:

Expand Down Expand Up @@ -81,7 +81,7 @@ RIOT provides features including, but not limited to:
* UWB
* Bluetooth (BLE) via [NimBLE](https://github.com/apache/mynewt-nimble)

## GETTING RIOT
## Getting RIOT

The most convenient way to get RIOT is to clone it via Git

Expand All @@ -106,7 +106,7 @@ For more details on our release cycle, check our [documentation][release cycle].
[releases]: https://github.com/RIOT-OS/RIOT/releases
[release cycle]: https://doc.riot-os.org/release-cycle.html

## GETTING STARTED
## Getting Started
* You want to start the RIOT? Just follow our
[quickstart guide](https://doc.riot-os.org/index.html#the-quickest-start) or
try this
Expand All @@ -117,23 +117,23 @@ For specific toolchain installation, follow instructions in the
version of the documentation is uploaded daily to
[doc.riot-os.org](https://doc.riot-os.org).

## FORUM
## Forum
Do you have a question, want to discuss a new feature, or just want to present
your latest project using RIOT? Come over to our [forum] and post to your hearts
content.

[forum]: https://forum.riot-os.org

## CONTRIBUTE
## Contribute

To contribute something to RIOT, please refer to our
[contributing document](CONTRIBUTING.md).

## MAILING LISTS
## Mailing Lists
* RIOT commits: [commits@riot-os.org](https://lists.riot-os.org/mailman/listinfo/commits)
* Github notifications: [notifications@riot-os.org](https://lists.riot-os.org/mailman/listinfo/notifications)

## LICENSE
## License
* Most of the code developed by the RIOT community is licensed under the GNU
Lesser General Public License (LGPL) version 2.1 as published by the Free
Software Foundation.
Expand Down
2 changes: 1 addition & 1 deletion boards/common/makefiles/stdio_cdc_acm.dep.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifeq (,$(filter-out stdio_cdc_acm,$(filter stdio_% slipdev_stdio,$(USEMODULE))))
ifneq (,$(filter tinyusb_device,$(USEMODULE)))
ifneq (,$(filter tinyusb_device,$(USEMODULE))$(filter tinyusb,$(USEPKG)))
# Use stdio_tinyusb_cdc_acm only if no other stdio is requested explicitly
# and tinyusb_device is used for any other reason
USEMODULE += stdio_tinyusb_cdc_acm
Expand Down
24 changes: 11 additions & 13 deletions core/lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ static void *idle_thread(void *arg)

void kernel_init(void)
{
if (!IS_USED(MODULE_CORE_THREAD)) {
/* RIOT without threads */
main_trampoline(NULL);
while (1) {}
return;
}

irq_disable();

if (IS_USED(MODULE_CORE_IDLE_THREAD)) {
Expand All @@ -99,19 +106,10 @@ void kernel_init(void)
idle_thread, NULL, "idle");
}

if (IS_USED(MODULE_CORE_THREAD)) {
thread_create(main_stack, sizeof(main_stack),
THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
main_trampoline, NULL, "main");
}
else {
/* RIOT without threads */
irq_enable();
main_trampoline(NULL);
while (1) {}
return;
}
thread_create(main_stack, sizeof(main_stack),
THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
main_trampoline, NULL, "main");

cpu_switch_context_exit();
}
Expand Down
2 changes: 1 addition & 1 deletion cpu/esp8266/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void esp_riot_init(void)
/* initialize the ISR stack for usage measurements */
thread_isr_stack_init();

#ifndef MCU_ESP8266
#ifndef CPU_ESP8266
/* initialize newlib system calls */
syscalls_init ();
#endif
Expand Down
6 changes: 3 additions & 3 deletions cpu/esp_common/esp-now/esp_now_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "esp_common.h"
#include "esp_attr.h"
#ifdef MCU_ESP8266
#ifdef CPU_ESP8266
#include "esp_event_loop.h"
#else
#include "esp_event.h"
Expand Down Expand Up @@ -314,11 +314,11 @@ esp_now_netdev_t *netdev_esp_now_setup(void)
/* set the event handler */
esp_system_event_add_handler(_esp_system_event_handler, NULL);

#ifdef MCU_ESP32
#ifdef CPU_ESP32
/* init the WiFi driver */
extern portMUX_TYPE g_intr_lock_mux;
mutex_init(&g_intr_lock_mux);
#endif /* MCU_ESP32 */
#endif /* CPU_ESP32 */

esp_err_t result;

Expand Down
36 changes: 18 additions & 18 deletions cpu/esp_common/esp-wifi/esp_wifi_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "esp_common.h"
#include "esp_attr.h"
#ifdef MCU_ESP8266
#ifdef CPU_ESP8266
#include "esp_event_loop.h"
#else
#include "esp_event.h"
Expand All @@ -38,7 +38,7 @@
#endif
#include "esp_system.h"
#include "esp_wifi.h"
#ifndef MCU_ESP8266
#ifndef CPU_ESP8266
#include "esp_private/wifi.h"
#endif
#include "irq_arch.h"
Expand Down Expand Up @@ -71,7 +71,7 @@
#define MAC_STR "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_STR_ARG(m) m[0], m[1], m[2], m[3], m[4], m[5]

#ifdef MCU_ESP8266
#ifdef CPU_ESP8266

#include "esp_socket.h"
#include "net/sockio.h"
Expand Down Expand Up @@ -99,7 +99,7 @@

#include "lwip/pbuf.h"

#endif /* MCU_ESP8266 */
#endif /* CPU_ESP8266 */

#define ENABLE_DEBUG_HEXDUMP 0
#define ENABLE_DEBUG 0
Expand All @@ -123,7 +123,7 @@ static bool _esp_wifi_rx_in_progress = false;
extern esp_err_t esp_system_event_add_handler (system_event_cb_t handler,
void *arg);

#ifdef MCU_ESP8266
#ifdef CPU_ESP8266

/**
* The low level WiFi driver function expects a lwIP pbuf data structure as
Expand Down Expand Up @@ -302,9 +302,9 @@ esp_err_t esp_wifi_internal_reg_rxcb(wifi_interface_t ifx, wifi_rxcb_t fn)
return ESP_OK;
}

#endif /* MCU_ESP8266 */
#endif /* CPU_ESP8266 */

#ifdef MCU_ESP8266
#ifdef CPU_ESP8266

/* Prolog for source code compatibility with ESP-IDF for ESP32 */
static int _esp_wifi_rx_cb(struct esp_aio *aio)
Expand All @@ -315,11 +315,11 @@ static int _esp_wifi_rx_cb(struct esp_aio *aio)
const char *buffer = aio->pbuf;
uint16_t len = aio->len;

#else /* MCU_ESP8266 */
#else /* CPU_ESP8266 */

esp_err_t _esp_wifi_rx_cb(void *buffer, uint16_t len, void *eb)
{
#endif /* MCU_ESP8266 */
#endif /* CPU_ESP8266 */

/*
* This callback function is not executed in interrupt context but in the
Expand Down Expand Up @@ -666,7 +666,7 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist)
/* send the the packet to the peer(s) mac address */
if (esp_wifi_internal_tx(WIFI_IF_STA, dev->tx_buf, dev->tx_len) == ESP_OK) {
#endif
#ifndef MCU_ESP8266
#ifndef CPU_ESP8266
/* for ESP8266 it is done in _esp_wifi_tx_cb */
_esp_wifi_send_is_in = false;
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
Expand Down Expand Up @@ -860,7 +860,7 @@ static wifi_config_t wifi_config_sta = {
};
#endif /* MODULE_ESP_WIFI_AP */

#if (defined(MCU_ESP8266) && !defined(MODULE_ESP_NOW)) || defined(MODULE_ESP_WIFI_AP)
#if (defined(CPU_ESP8266) && !defined(MODULE_ESP_NOW)) || defined(MODULE_ESP_WIFI_AP)
/**
* Static configuration for the SoftAP interface if ESP-NOW is not enabled.
*
Expand Down Expand Up @@ -901,7 +901,7 @@ static wifi_config_t wifi_config_ap = {
#endif
}
};
#endif /* (defined(MCU_ESP8266) && !defined(MODULE_ESP_NOW)) || defined(MODULE_ESP_WIFI_AP) */
#endif /* (defined(CPU_ESP8266) && !defined(MODULE_ESP_NOW)) || defined(MODULE_ESP_WIFI_AP) */

void esp_wifi_setup (esp_wifi_netdev_t* dev)
{
Expand All @@ -922,7 +922,7 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)

#ifndef MODULE_ESP_NOW
/* if module esp_now is used, the following part is already done */
#ifndef MCU_ESP8266
#ifndef CPU_ESP8266
extern portMUX_TYPE g_intr_lock_mux;
mutex_init(&g_intr_lock_mux);
#endif
Expand All @@ -949,7 +949,7 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)
#ifdef MODULE_ESP_WIFI_AP
/* Activate the SoftAP interface */
result = esp_wifi_set_mode(WIFI_MODE_AP);
#elif defined(MCU_ESP8266)
#elif defined(CPU_ESP8266)
/*
* Although only the Station interface is needed, the SoftAP interface must
* also be enabled on ESP8266 for stability reasons to prevent the Station
Expand All @@ -959,16 +959,16 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)
*/
/* activate the Station and the SoftAP interface */
result = esp_wifi_set_mode(WIFI_MODE_APSTA);
#else /* defined(MCU_ESP8266) */
#else /* defined(CPU_ESP8266) */
/* activate only the Station interface */
result = esp_wifi_set_mode(WIFI_MODE_STA);
#endif /* defined(MCU_ESP8266) */
#endif /* defined(CPU_ESP8266) */
if (result != ESP_OK) {
ESP_WIFI_LOG_ERROR("esp_wifi_set_mode failed with return value %d", result);
return;
}

#if defined(MCU_ESP8266) || defined(MODULE_ESP_WIFI_AP)
#if defined(CPU_ESP8266) || defined(MODULE_ESP_WIFI_AP)
#if IS_ACTIVE(ESP_WIFI_SSID_DYNAMIC)
uint8_t mac[ETHERNET_ADDR_LEN];
esp_wifi_get_mac(WIFI_IF_AP, mac);
Expand All @@ -982,7 +982,7 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)
ESP_WIFI_LOG_ERROR("esp_wifi_set_config softap failed with return value %d", result);
return;
}
#endif /* defined(MCU_ESP8266) || defined(MODULE_ESP_WIFI_AP) */
#endif /* defined(CPU_ESP8266) || defined(MODULE_ESP_WIFI_AP) */

#endif /* MODULE_ESP_NOW */

Expand Down
14 changes: 7 additions & 7 deletions cpu/esp_common/esp-xtensa/thread_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
#define ENABLE_DEBUG 0
#include "debug.h"

#if defined(MCU_ESP32)
#if defined(CPU_ESP32)
#include "soc/dport_access.h"
#include "soc/dport_reg.h"
#elif defined(MCU_ESP8266)
#elif defined(CPU_ESP8266)
#include "esp8266/rom_functions.h"
#include "sdk/sdk.h"
#endif /* MCU_ESP32 */
#endif /* CPU_ESP32 */

#include "esp/xtensa_ops.h"
#include "xtensa/xtensa_context.h"
Expand Down Expand Up @@ -215,7 +215,7 @@ char* thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
return (char*)sp;
}

#ifdef MCU_ESP8266
#ifdef CPU_ESP8266
extern int MacIsrSigPostDefHdl(void);
unsigned int ets_soft_int_type = ETS_SOFT_INT_NONE;
#endif
Expand All @@ -227,7 +227,7 @@ unsigned int ets_soft_int_type = ETS_SOFT_INT_NONE;
*/
void IRAM_ATTR thread_yield_isr(void* arg)
{
#ifdef MCU_ESP8266
#ifdef CPU_ESP8266
ETS_NMI_LOCK();

if (ets_soft_int_type == ETS_SOFT_INT_HDL_MAC) {
Expand Down Expand Up @@ -281,7 +281,7 @@ void IRAM_ATTR thread_yield_higher(void)
}
#endif
if (!irq_is_in()) {
#if defined(MCU_ESP8266)
#if defined(CPU_ESP8266)
critical_enter();
ets_soft_int_type = ETS_SOFT_INT_YIELD;
WSR(BIT(ETS_SOFT_INUM), interrupt);
Expand All @@ -292,7 +292,7 @@ void IRAM_ATTR thread_yield_higher(void)
#else
/* generate the software interrupt to switch the context */
DPORT_WRITE_PERI_REG(SYSTEM_CPU_INTR_FROM_CPU_0_REG, SYSTEM_CPU_INTR_FROM_CPU_0);
#endif /* MCU_ESP8266 */
#endif /* CPU_ESP8266 */
}
else {
/* set the context switch flag */
Expand Down
Loading

0 comments on commit e3d432e

Please sign in to comment.