Skip to content

Commit 7216977

Browse files
authored
Update IDF to 3a271a4 (#735)
1 parent 9fe3230 commit 7216977

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+576
-481
lines changed

Diff for: tools/platformio-build.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
join(FRAMEWORK_DIR, "tools", "sdk", "include", "newlib"),
7171
join(FRAMEWORK_DIR, "tools", "sdk", "include", "nvs_flash"),
7272
join(FRAMEWORK_DIR, "tools", "sdk", "include", "openssl"),
73-
join(FRAMEWORK_DIR, "tools", "sdk", "include", "soc"),
7473
join(FRAMEWORK_DIR, "tools", "sdk", "include", "spi_flash"),
7574
join(FRAMEWORK_DIR, "tools", "sdk", "include", "sdmmc"),
7675
join(FRAMEWORK_DIR, "tools", "sdk", "include", "spiffs"),
@@ -80,6 +79,7 @@
8079
join(FRAMEWORK_DIR, "tools", "sdk", "include", "wear_levelling"),
8180
join(FRAMEWORK_DIR, "tools", "sdk", "include", "xtensa-debug-module"),
8281
join(FRAMEWORK_DIR, "tools", "sdk", "include", "console"),
82+
join(FRAMEWORK_DIR, "tools", "sdk", "include", "soc"),
8383
join(FRAMEWORK_DIR, "tools", "sdk", "include", "newlib"),
8484
join(FRAMEWORK_DIR, "tools", "sdk", "include", "coap"),
8585
join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"),
@@ -94,7 +94,7 @@
9494
join(FRAMEWORK_DIR, "tools", "sdk", "ld")
9595
],
9696
LIBS=[
97-
"gcc", "stdc++", "app_trace", "app_update", "bootloader_support", "bt", "btdm_app", "c", "c_nano", "coap", "coexist", "console", "core", "cxx", "driver", "esp32", "esp_adc_cal", "espnow", "ethernet", "expat", "fatfs", "freertos", "hal", "heap", "jsmn", "json", "log", "lwip", "m", "mbedtls", "mdns", "micro-ecc", "net80211", "newlib", "nghttp", "nvs_flash", "openssl", "phy", "pp", "pthread", "rtc", "sdmmc", "smartconfig", "soc", "spi_flash", "spiffs", "tcpip_adapter", "ulp", "vfs", "wear_levelling", "wpa", "wpa2", "wpa_supplicant", "wps", "xtensa-debug-module"
97+
"gcc", "app_trace", "app_update", "bootloader_support", "bt", "btdm_app", "c", "c_nano", "coap", "coexist", "console", "core", "cxx", "driver", "esp32", "esp_adc_cal", "espnow", "ethernet", "expat", "fatfs", "freertos", "hal", "heap", "jsmn", "json", "log", "lwip", "m", "mbedtls", "mdns", "micro-ecc", "net80211", "newlib", "nghttp", "nvs_flash", "openssl", "phy", "pp", "pthread", "rtc", "sdmmc", "smartconfig", "soc", "spi_flash", "spiffs", "tcpip_adapter", "ulp", "vfs", "wear_levelling", "wpa", "wpa2", "wpa_supplicant", "wps", "xtensa-debug-module", "stdc++"
9898
],
9999

100100
UPLOADERFLAGS=[

Diff for: tools/sdk/include/bluedroid/bta_api.h

+21-1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
402402

403403
typedef void (tBTA_START_ADV_CMPL_CBACK) (tBTA_STATUS status);
404404

405+
typedef tBTM_ADD_WHITELIST_CBACK tBTA_ADD_WHITELIST_CBACK;
406+
405407
typedef tBTM_SET_PKT_DATA_LENGTH_CBACK tBTA_SET_PKT_DATA_LENGTH_CBACK;
406408

407409
typedef tBTM_SET_LOCAL_PRIVACY_CBACK tBTA_SET_LOCAL_PRIVACY_CBACK;
@@ -1410,7 +1412,7 @@ extern void BTA_DisableTestMode(void);
14101412
*******************************************************************************/
14111413
extern void BTA_DmSetDeviceName(char *p_name);
14121414

1413-
extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr);
1415+
extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBTA_ADD_WHITELIST_CBACK *add_wl_cb);
14141416

14151417
extern void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb);
14161418

@@ -2034,6 +2036,24 @@ extern void BTA_DmBleObserve(BOOLEAN start, UINT32 duration,
20342036
tBTA_DM_SEARCH_CBACK *p_results_cb,
20352037
tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb);
20362038

2039+
/*******************************************************************************
2040+
**
2041+
** Function BTA_DmBleScan
2042+
**
2043+
** Description This procedure keep the device listening for advertising
2044+
** events from a broadcast device.
2045+
**
2046+
** Parameters start: start or stop observe.
2047+
** duration : Duration of the scan. Continuous scan if 0 is passed
2048+
** p_results_cb: Callback to be called with scan results
2049+
**
2050+
** Returns void
2051+
**
2052+
*******************************************************************************/
2053+
extern void BTA_DmBleScan(BOOLEAN start, UINT32 duration,
2054+
tBTA_DM_SEARCH_CBACK *p_results_cb,
2055+
tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb);
2056+
20372057
extern void BTA_DmBleStopAdvertising(void);
20382058

20392059
extern void BTA_DmSetRandAddress(BD_ADDR rand_addr);

Diff for: tools/sdk/include/bluedroid/bta_gattc_int.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ typedef UINT16 tBTA_GATTC_INT_EVT;
7272

7373
/* max client application GATTC can support */
7474
#ifndef BTA_GATTC_CL_MAX
75-
#define BTA_GATTC_CL_MAX 3 // 32
75+
#if (GATT_MAX_PHY_CHANNEL > 3)
76+
#define BTA_GATTC_CL_MAX GATT_MAX_PHY_CHANNEL
77+
#else
78+
#define BTA_GATTC_CL_MAX 3 // The origin value is 10
79+
#endif
7680
#endif
7781

7882
/* max known devices GATTC can support */

Diff for: tools/sdk/include/bluedroid/btm_api.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ typedef struct {
146146
UINT16 supervision_tout;
147147
}tBTM_LE_UPDATE_CONN_PRAMS;
148148

149+
typedef enum{
150+
BTM_WHITELIST_REMOVE = 0X00,
151+
BTM_WHITELIST_ADD = 0X01,
152+
}tBTM_WL_OPERATION;
153+
149154

150155
typedef void (tBTM_DEV_STATUS_CB) (tBTM_DEV_STATUS status);
151156

@@ -177,6 +182,8 @@ typedef void (tBTM_UPDATE_CONN_PARAM_CBACK) (UINT8 status, BD_ADDR bd_addr, tBTM
177182

178183
typedef void (tBTM_SET_PKT_DATA_LENGTH_CBACK) (UINT8 status, tBTM_LE_SET_PKT_DATA_LENGTH_PARAMS *data_length_params);
179184

185+
typedef void (tBTM_ADD_WHITELIST_CBACK) (UINT8 status, tBTM_WL_OPERATION wl_opration);
186+
180187
typedef void (tBTM_SET_LOCAL_PRIVACY_CBACK) (UINT8 status);
181188

182189

@@ -234,7 +241,7 @@ typedef void (tBTM_SET_LOCAL_PRIVACY_CBACK) (UINT8 status);
234241

235242
/* inquiry activity mask */
236243
#define BTM_BR_INQ_ACTIVE_MASK (BTM_GENERAL_INQUIRY_ACTIVE|BTM_LIMITED_INQUIRY_ACTIVE|BTM_PERIODIC_INQUIRY_ACTIVE) /* BR/EDR inquiry activity mask */
237-
#define BTM_BLE_SCAN_ACTIVE_MASK 0xF0 /* LE scan activity mask */
244+
#define BTM_BLE_SCAN_ACTIVE_MASK 0x01F0 /* LE scan activity mask */
238245
#define BTM_BLE_INQ_ACTIVE_MASK (BTM_LE_GENERAL_INQUIRY_ACTIVE|BTM_LE_LIMITED_INQUIRY_ACTIVE) /* LE inquiry activity mask*/
239246
#define BTM_INQUIRY_ACTIVE_MASK (BTM_BR_INQ_ACTIVE_MASK | BTM_BLE_INQ_ACTIVE_MASK) /* inquiry activity mask */
240247

Diff for: tools/sdk/include/bluedroid/btm_ble_api.h

+17-1
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,22 @@ tBTM_STATUS BTM_BleWriteScanRspRaw(UINT8 *p_raw_scan_rsp, UINT32 raw_scan_rsp_le
12071207
tBTM_STATUS BTM_BleObserve(BOOLEAN start, UINT32 duration,
12081208
tBTM_INQ_RESULTS_CB *p_results_cb, tBTM_CMPL_CB *p_cmpl_cb);
12091209

1210+
/*******************************************************************************
1211+
**
1212+
** Function BTM_BleScan
1213+
**
1214+
** Description This procedure keep the device listening for advertising
1215+
** events from a broadcast device.
1216+
**
1217+
** Parameters start: start or stop scan.
1218+
**
1219+
** Returns void
1220+
**
1221+
*******************************************************************************/
1222+
//extern
1223+
tBTM_STATUS BTM_BleScan(BOOLEAN start, UINT32 duration,
1224+
tBTM_INQ_RESULTS_CB *p_results_cb, tBTM_CMPL_CB *p_cmpl_cb);
1225+
12101226

12111227
/*******************************************************************************
12121228
**
@@ -1695,7 +1711,7 @@ void BTM_BleTurnOnPrivacyOnRemote(BD_ADDR bd_addr,
16951711
**
16961712
*******************************************************************************/
16971713
//extern
1698-
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda);
1714+
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
16991715

17001716
/*******************************************************************************
17011717
**

Diff for: tools/sdk/include/bluedroid/btm_ble_int.h

+13-5
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ typedef UINT8 tBTM_BLE_SEC_REQ_ACT;
8686
#define BTM_BLE_IS_RESOLVE_BDA(x) ((x[0] & BLE_RESOLVE_ADDR_MASK) == BLE_RESOLVE_ADDR_MSB)
8787

8888
/* LE scan activity bit mask, continue with LE inquiry bits */
89-
#define BTM_LE_SELECT_CONN_ACTIVE 0x40 /* selection connection is in progress */
90-
#define BTM_LE_OBSERVE_ACTIVE 0x80 /* observe is in progress */
89+
#define BTM_LE_SELECT_CONN_ACTIVE 0x0040 /* selection connection is in progress */
90+
#define BTM_LE_OBSERVE_ACTIVE 0x0080 /* observe is in progress */
91+
#define BTM_LE_DISCOVER_ACTIVE 0x0100 /* scan is in progress */
9192

9293
/* BLE scan activity mask checking */
9394
#define BTM_BLE_IS_SCAN_ACTIVE(x) ((x) & BTM_BLE_SCAN_ACTIVE_MASK)
9495
#define BTM_BLE_IS_INQ_ACTIVE(x) ((x) & BTM_BLE_INQUIRY_MASK)
9596
#define BTM_BLE_IS_OBS_ACTIVE(x) ((x) & BTM_LE_OBSERVE_ACTIVE)
97+
#define BTM_BLE_IS_DISCO_ACTIVE(x) ((x) & BTM_LE_DISCOVER_ACTIVE)
9698
#define BTM_BLE_IS_SEL_CONN_ACTIVE(x) ((x) & BTM_LE_SELECT_CONN_ACTIVE)
9799

98100
/* BLE ADDR type ID bit */
@@ -136,6 +138,7 @@ typedef struct {
136138
typedef struct {
137139
UINT16 discoverable_mode;
138140
UINT16 connectable_mode;
141+
BOOLEAN scan_params_set;
139142
UINT32 scan_window;
140143
UINT32 scan_interval;
141144
UINT8 scan_type; /* current scan type: active or passive */
@@ -294,7 +297,7 @@ typedef void (tBTM_DATA_LENGTH_CHANGE_CBACK) (UINT16 max_tx_length, UINT16 max_r
294297
/* Define BLE Device Management control structure
295298
*/
296299
typedef struct {
297-
UINT8 scan_activity; /* LE scan activity mask */
300+
UINT16 scan_activity; /* LE scan activity mask */
298301

299302
/*****************************************************
300303
** BLE Inquiry
@@ -306,6 +309,11 @@ typedef struct {
306309
tBTM_CMPL_CB *p_obs_cmpl_cb;
307310
TIMER_LIST_ENT obs_timer_ent;
308311

312+
/* scan callback and timer */
313+
tBTM_INQ_RESULTS_CB *p_scan_results_cb;
314+
tBTM_CMPL_CB *p_scan_cmpl_cb;
315+
TIMER_LIST_ENT scan_timer_ent;
316+
309317
/* background connection procedure cb value */
310318
tBTM_BLE_CONN_TYPE bg_conn_type;
311319
UINT32 scan_int;
@@ -314,6 +322,7 @@ typedef struct {
314322

315323
/* white list information */
316324
UINT8 white_list_avail_size;
325+
tBTM_ADD_WHITELIST_CBACK *add_wl_cb;
317326
tBTM_BLE_WL_STATE wl_state;
318327

319328
fixed_queue_t *conn_pending_q;
@@ -357,7 +366,6 @@ tBTM_STATUS btm_ble_start_inquiry (UINT8 mode, UINT8 duration);
357366
void btm_ble_stop_scan(void);
358367
void btm_clear_all_pending_le_entry(void);
359368

360-
void btm_ble_stop_scan();
361369
BOOLEAN btm_ble_send_extended_scan_params(UINT8 scan_type, UINT32 scan_int,
362370
UINT32 scan_win, UINT8 addr_type_own,
363371
UINT8 scan_filter_policy);
@@ -405,7 +413,7 @@ void btm_ble_update_sec_key_size(BD_ADDR bd_addr, UINT8 enc_key_size);
405413
UINT8 btm_ble_read_sec_key_size(BD_ADDR bd_addr);
406414

407415
/* white list function */
408-
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr);
416+
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
409417
void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy);
410418
void btm_update_adv_filter_policy(tBTM_BLE_AFP adv_policy);
411419
void btm_ble_clear_white_list (void);

Diff for: tools/sdk/include/bluedroid/btu.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
160160
#define BTU_TTYPE_BLE_GAP_FAST_ADV 106
161161
#define BTU_TTYPE_BLE_OBSERVE 107
162162

163-
164163
#define BTU_TTYPE_UCD_TO 108
165-
164+
#define BTU_TTYPE_BLE_SCAN 109
166165

167166

168167
/* This is the inquiry response information held by BTU, and available

Diff for: tools/sdk/include/bluedroid/esp_gap_ble_api.h

+18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ typedef enum {
9797
ESP_GAP_BLE_CLEAR_BOND_DEV_COMPLETE_EVT, /*!< When clear the bond device clear complete, the event comes */
9898
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
9999
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
100+
ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
100101
ESP_GAP_BLE_EVT_MAX,
101102
} esp_gap_ble_cb_event_t;
102103

@@ -462,6 +463,10 @@ typedef enum {
462463
ESP_BLE_EVT_SCAN_RSP = 0x04, /*!< Scan Response (SCAN_RSP) */
463464
} esp_ble_evt_type_t;
464465

466+
typedef enum{
467+
ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */
468+
ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */
469+
}esp_ble_wl_opration;
465470
/**
466471
* @brief Gap callback parameters union
467472
*/
@@ -600,6 +605,13 @@ typedef union {
600605
if the RSSI cannot be read, the RSSI metric shall be set to 127. */
601606
esp_bd_addr_t remote_addr; /*!< The remote device address */
602607
} read_rssi_cmpl; /*!< Event parameter of ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT */
608+
/**
609+
* @brief ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT
610+
*/
611+
struct ble_add_whitelist_cmpl_evt_param {
612+
esp_bt_status_t status; /*!< Indicate the add or remove whitelist operation success status */
613+
esp_ble_wl_opration wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */
614+
} add_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADD_WHITELIST_COMPLETE_EVT */
603615
} esp_ble_gap_cb_param_t;
604616

605617
/**
@@ -972,6 +984,12 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis
972984

973985
/**
974986
* @brief This function is to disconnect the physical connection of the peer device
987+
* gattc maybe have multiple virtual GATT server connections when multiple app_id registed.
988+
* esp_ble_gattc_close (esp_gatt_if_t gattc_if, uint16_t conn_id) only close one virtual GATT server connection.
989+
* if there exist other virtual GATT server connections, it does not disconnect the physical connection.
990+
* esp_ble_gap_disconnect(esp_bd_addr_t remote_device) disconnect the physical connection directly.
991+
*
992+
*
975993
*
976994
* @param[in] remote_device : BD address of the peer device
977995
*

Diff for: tools/sdk/include/bt/bt.h

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ typedef enum {
7878
ESP_BT_CONTROLLER_STATUS_IDLE = 0,
7979
ESP_BT_CONTROLLER_STATUS_INITED,
8080
ESP_BT_CONTROLLER_STATUS_ENABLED,
81-
ESP_BT_CONTROLLER_STATUS_SHUTDOWN,
8281
ESP_BT_CONTROLLER_STATUS_NUM,
8382
} esp_bt_controller_status_t;
8483

Diff for: tools/sdk/include/config/sdkconfig.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1
4848
#define CONFIG_CONSOLE_UART_BAUDRATE 115200
4949
#define CONFIG_LWIP_MAX_SOCKETS 10
50+
#define CONFIG_LWIP_NETIF_LOOPBACK 1
5051
#define CONFIG_EMAC_TASK_PRIORITY 20
5152
#define CONFIG_TIMER_TASK_STACK_DEPTH 2048
5253
#define CONFIG_TCP_MSS 1436
@@ -84,7 +85,7 @@
8485
#define CONFIG_TCPIP_TASK_STACK_SIZE 2560
8586
#define CONFIG_FATFS_CODEPAGE_850 1
8687
#define CONFIG_TASK_WDT 1
87-
#define CONFIG_MAIN_TASK_STACK_SIZE 4096
88+
#define CONFIG_MAIN_TASK_STACK_SIZE 8192
8889
#define CONFIG_SPIFFS_PAGE_CHECK 1
8990
#define CONFIG_TASK_WDT_TIMEOUT_S 5
9091
#define CONFIG_INT_WDT_TIMEOUT_MS 300
@@ -105,6 +106,7 @@
105106
#define CONFIG_ESP32_WIFI_NVS_ENABLED 1
106107
#define CONFIG_ULP_COPROC_ENABLED 1
107108
#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1
109+
#define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1
108110
#define CONFIG_DMA_RX_BUF_NUM 10
109111
#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1
110112
#define CONFIG_TCP_SYNMAXRTX 6
@@ -119,6 +121,7 @@
119121
#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1
120122
#define CONFIG_TCP_MSL 60000
121123
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1
124+
#define CONFIG_LWIP_SO_REUSE_RXTOALL 1
122125
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
123126
#define CONFIG_ESP32_WIFI_RX_BA_WIN 6
124127
#define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1
@@ -179,7 +182,6 @@
179182
#define CONFIG_MBEDTLS_TLS_SERVER 1
180183
#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1
181184
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
182-
#define CONFIG_CLASSIC_BT_ENABLED 1
183185
#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1
184186
#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1
185187
#define CONFIG_WL_SECTOR_SIZE_4096 1
@@ -192,6 +194,7 @@
192194
#define CONFIG_FATFS_MAX_LFN 255
193195
#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1
194196
#define CONFIG_ESPTOOLPY_BAUD_921600B 1
197+
#define CONFIG_LWIP_LOOPBACK_MAX_PBUFS 8
195198
#define CONFIG_APP_OFFSET 0x10000
196199
#define CONFIG_MEMMAP_SMP 1
197200
#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1

Diff for: tools/sdk/include/driver/driver/i2s.h

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ typedef enum {
122122
I2S_MODE_PDM = 64,
123123
} i2s_mode_t;
124124

125+
126+
125127
/**
126128
* @brief I2S configuration parameters for i2s_param_config function
127129
*
@@ -135,6 +137,7 @@ typedef struct {
135137
int intr_alloc_flags; /*!< Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info */
136138
int dma_buf_count; /*!< I2S DMA Buffer Count */
137139
int dma_buf_len; /*!< I2S DMA Buffer Length */
140+
int use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
138141
} i2s_config_t;
139142

140143
/**

Diff for: tools/sdk/include/driver/driver/ledc.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626

2727
#define LEDC_APB_CLK_HZ (APB_CLK_FREQ)
2828
#define LEDC_REF_CLK_HZ (1*1000000)
29+
#define LEDC_ERR_DUTY (0xFFFFFFFF)
2930

3031
typedef enum {
3132
LEDC_HIGH_SPEED_MODE = 0, /*!< LEDC high speed speed_mode */
@@ -206,10 +207,10 @@ esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t
206207
* @param channel LEDC channel(0-7), select from ledc_channel_t
207208
*
208209
* @return
209-
* - (-1) parameter error
210+
* - LEDC_ERR_DUTY if parameter error
210211
* - Others Current LEDC duty
211212
*/
212-
int ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
213+
uint32_t ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
213214

214215
/**
215216
* @brief LEDC set gradient
@@ -329,7 +330,7 @@ esp_err_t ledc_bind_channel_timer(ledc_mode_t speed_mode, uint32_t channel, uint
329330
* - ESP_ERR_INVALID_STATE Fade function not installed.
330331
* - ESP_FAIL Fade function init error
331332
*/
332-
esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, int target_duty, int scale, int cycle_num);
333+
esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int scale, int cycle_num);
333334

334335
/**
335336
* @brief Set LEDC fade function, with a limited time. Should call ledc_fade_func_install() before calling this function.
@@ -346,7 +347,7 @@ esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel
346347
* - ESP_ERR_INVALID_STATE Fade function not installed.
347348
* - ESP_FAIL Fade function init error
348349
*/
349-
esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, int target_duty, int max_fade_time_ms);
350+
esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int max_fade_time_ms);
350351

351352
/**
352353
* @brief Install ledc fade function. This function will occupy interrupt of LEDC module.

0 commit comments

Comments
 (0)