mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 01:53:51 +01:00
cpu/esp*: cleanups mainly to reduce the vera++ warnings
This commit is contained in:
parent
0ddb6022f3
commit
a24ddb8517
@ -37,7 +37,6 @@
|
||||
#error "ESP32x family implementation missing"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
#include "esp_common.h"
|
||||
#include "soc/adc_channel.h"
|
||||
|
||||
|
||||
#define ENABLE_DEBUG 0
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ static bool _gpio_pin_pd[GPIO_PIN_NUMOF] = { };
|
||||
#if defined(CPU_FAM_ESP32)
|
||||
|
||||
#define GPIO_IN_GET(b) (b < 32) ? GPIO.in & BIT(b) : GPIO.in1.val & BIT(b-32)
|
||||
#define GPIO_OUT_SET(b) if (b < 32) GPIO.out_w1ts = BIT(b); else GPIO.out1_w1ts.val = BIT(b-32)
|
||||
#define GPIO_OUT_CLR(b) if (b < 32) GPIO.out_w1tc = BIT(b); else GPIO.out1_w1tc.val = BIT(b-32)
|
||||
#define GPIO_OUT_XOR(b) if (b < 32) GPIO.out ^= BIT(b); else GPIO.out1.val ^= BIT(b-32)
|
||||
#define GPIO_OUT_SET(b) if (b < 32) { GPIO.out_w1ts = BIT(b); } else { GPIO.out1_w1ts.val = BIT(b-32); }
|
||||
#define GPIO_OUT_CLR(b) if (b < 32) { GPIO.out_w1tc = BIT(b); } else { GPIO.out1_w1tc.val = BIT(b-32); }
|
||||
#define GPIO_OUT_XOR(b) if (b < 32) { GPIO.out ^= BIT(b); } else { GPIO.out1.val ^= BIT(b-32); }
|
||||
#define GPIO_OUT_GET(b) (b < 32) ? (GPIO.out >> b) & 1 : (GPIO.out1.val >> (b-32)) & 1
|
||||
|
||||
#else
|
||||
|
||||
@ -959,8 +959,7 @@ void esp_wifi_setup (esp_wifi_netdev_t* dev)
|
||||
esp_wifi_sta_wpa2_ent_set_password((const unsigned char *)ESP_WIFI_EAP_PASS,
|
||||
strlen(ESP_WIFI_EAP_PASS));
|
||||
#else /* defined(ESP_WIFI_EAP_USER) && defined(ESP_WIFI_EAP_PASS) */
|
||||
#error ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to define the user name \
|
||||
and the password for EAP phase 2 authentication in esp_wifi_enterprise
|
||||
#error "ESP_WIFI_EAP_USER and ESP_WIFI_EAP_PASS have to be defined for EAP phase 2 authentication"
|
||||
#endif /* defined(ESP_WIFI_EAP_USER) && defined(ESP_WIFI_EAP_PASS) */
|
||||
esp_wifi_sta_wpa2_ent_enable();
|
||||
#endif /* defined(MODULE_ESP_WIFI_ENTERPRISE) && !defined(MODULE_ESP_WIFI_AP) */
|
||||
|
||||
@ -33,11 +33,11 @@
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
#define MHZ 1000000
|
||||
|
||||
#ifdef MCU_ESP8266
|
||||
#include "rom/ets_sys.h"
|
||||
#endif
|
||||
|
||||
#ifndef PRO_CPU_NUM
|
||||
#define PRO_CPU_NUM (0)
|
||||
#endif
|
||||
|
||||
@ -371,7 +371,7 @@ BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry,
|
||||
{
|
||||
kernel_pid_t pid = thread_getpid();
|
||||
|
||||
DEBUG("%s task=%d entry=%08"PRIx32" exit=%08"PRIx32" wait=%u\n", __func__,
|
||||
DEBUG("%s task=%d entry=%08"PRIx32" exit=%08"PRIx32" wait=%"PRIu32"\n", __func__,
|
||||
pid, ulBitsToClearOnEntry, ulBitsToClearOnExit, xTicksToWait);
|
||||
|
||||
assert(pid_is_valid(pid));
|
||||
|
||||
@ -88,8 +88,8 @@ extern "C" {
|
||||
|
||||
#else /* ENABLE_DEBUG */
|
||||
|
||||
#define CHECK_PARAM_RET(cond,err) if (!(cond)) return err;
|
||||
#define CHECK_PARAM(cond) if (!(cond)) return;
|
||||
#define CHECK_PARAM_RET(cond, err) if (!(cond)) { return err; }
|
||||
#define CHECK_PARAM(cond) if (!(cond)) { return; }
|
||||
|
||||
#endif /* ENABLE_DEBUG */
|
||||
|
||||
|
||||
@ -36,8 +36,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief Definition of possible GPIO usage types (for internal use only)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
_GPIO = 0, /**< pin used as standard GPIO */
|
||||
#ifndef MCU_ESP8266
|
||||
_ADC, /**< pin is used as ADC input */
|
||||
|
||||
@ -59,8 +59,8 @@
|
||||
#define I2C_CLOCK_STRETCH 200
|
||||
|
||||
/* gpio access macros */
|
||||
#define GPIO_SET(l,h,b) if (b < 32) GPIO.l = BIT(b); else GPIO.h.val = BIT(b-32)
|
||||
#define GPIO_GET(l,h,b) ((b < 32) ? GPIO.l & BIT(b) : GPIO.h.val & BIT(b-32))
|
||||
#define GPIO_SET(lo, hi, b) if (b < 32) { GPIO.lo = BIT(b); } else { GPIO.hi.val = BIT(b-32); }
|
||||
#define GPIO_GET(lo, hi, b) ((b < 32) ? GPIO.lo & BIT(b) : GPIO.hi.val & BIT(b-32))
|
||||
|
||||
#else /* MCU_ESP8266 */
|
||||
|
||||
@ -86,8 +86,7 @@ extern bool system_update_cpu_freq(uint8_t freq);
|
||||
|
||||
#endif /* MCU_ESP8266 */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
i2c_speed_t speed;
|
||||
i2c_t dev;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user