Merge branch 'feature/update-freertos-module-handles-to-struct-type' into 'master'

freertos: update module handles to struct type

Closes IDF-3768, IDF-3769, and IDF-3770

See merge request espressif/esp-idf!15766
This commit is contained in:
Sudeep Mohanty
2021-12-07 04:40:29 +00:00
11 changed files with 19 additions and 37 deletions

View File

@@ -24,7 +24,7 @@
#include "osi/thread.h" #include "osi/thread.h"
struct osi_thread { struct osi_thread {
void *thread_handle; /*!< Store the thread object */ TaskHandle_t thread_handle; /*!< Store the thread object */
int thread_id; /*!< May for some OS, such as Linux */ int thread_id; /*!< May for some OS, such as Linux */
bool stop; bool stop;
uint8_t work_queue_num; /*!< Work queue number */ uint8_t work_queue_num; /*!< Work queue number */

View File

@@ -123,7 +123,7 @@ struct MockMutex : public CMockFix {
}; };
struct MockTask : public CMockFix { struct MockTask : public CMockFix {
MockTask (CreateAnd flags) : task((void*) 1) MockTask (CreateAnd flags) : task((TaskHandle_t) 1)
{ {
if (flags == CreateAnd::FAIL) { if (flags == CreateAnd::FAIL) {
xTaskCreatePinnedToCore_ExpectAnyArgsAndReturn(pdFALSE); xTaskCreatePinnedToCore_ExpectAnyArgsAndReturn(pdFALSE);

View File

@@ -84,11 +84,8 @@
* \ingroup EventGroup * \ingroup EventGroup
*/ */
struct EventGroupDef_t; struct EventGroupDef_t;
#ifdef ESP_PLATFORM // IDF-3770 typedef struct EventGroupDef_t * EventGroupHandle_t;
typedef void * EventGroupHandle_t;
#else
typedef struct EventGroupDef_t * EventGroupHandle_t;
#endif // ESP_PLATFORM
/* /*
* The type that holds event bits always matches TickType_t - therefore the * The type that holds event bits always matches TickType_t - therefore the
* number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1, * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,

View File

@@ -82,12 +82,9 @@
* \ingroup Tasks * \ingroup Tasks
*/ */
struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */ struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
#ifdef ESP_PLATFORM // IDF-3769 typedef struct tskTaskControlBlock * TaskHandle_t;
typedef void* TaskHandle_t;
#else /*
typedef struct tskTaskControlBlock* TaskHandle_t;
#endif // ESP_PLATFORM
/**
* Defines the prototype to which the application task hook function must * Defines the prototype to which the application task hook function must
* conform. * conform.
*/ */

View File

@@ -75,11 +75,8 @@
* (for example, xTimerStart(), xTimerReset(), etc.). * (for example, xTimerStart(), xTimerReset(), etc.).
*/ */
struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debuggers. */ struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
#ifdef ESP_PLATFORM // IDF-3768
typedef void* TimerHandle_t;
#else
typedef struct tmrTimerControl * TimerHandle_t; typedef struct tmrTimerControl * TimerHandle_t;
#endif // ESP_PLATFORM
/* /*
* Defines the prototype to which timer callback functions must conform. * Defines the prototype to which timer callback functions must conform.
*/ */

View File

@@ -5315,7 +5315,7 @@ TickType_t uxTaskResetEventItemValue( void )
#if ( configUSE_MUTEXES == 1 ) #if ( configUSE_MUTEXES == 1 )
void *pvTaskIncrementMutexHeldCount( void ) TaskHandle_t pvTaskIncrementMutexHeldCount( void )
{ {
TCB_t * curTCB; TCB_t * curTCB;

View File

@@ -361,7 +361,7 @@ TEST_CASE("Test suspend-resume CPU. The number of tick_hook should be the same f
static int duration_timer_ms; static int duration_timer_ms;
static void timer_callback(void *arg) static void timer_callback(TimerHandle_t arg)
{ {
duration_timer_ms += portTICK_PERIOD_MS; duration_timer_ms += portTICK_PERIOD_MS;
} }

View File

@@ -71,7 +71,7 @@ static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len);
/// callback function for AVRCP controller /// callback function for AVRCP controller
static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param); static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param);
static void a2d_app_heart_beat(void *arg); static void a2d_app_heart_beat(TimerHandle_t arg);
/// A2DP application state machine /// A2DP application state machine
static void bt_app_av_sm_hdlr(uint16_t event, void *param); static void bt_app_av_sm_hdlr(uint16_t event, void *param);
@@ -394,7 +394,7 @@ static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len)
return len; return len;
} }
static void a2d_app_heart_beat(void *arg) static void a2d_app_heart_beat(TimerHandle_t arg)
{ {
bt_app_work_dispatch(bt_app_av_sm_hdlr, BT_APP_HEART_BEAT_EVT, NULL, 0, NULL); bt_app_work_dispatch(bt_app_av_sm_hdlr, BT_APP_HEART_BEAT_EVT, NULL, 0, NULL);
} }

View File

@@ -1,16 +1,8 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -746,7 +738,7 @@ static void light_fade_timer_stop(void)
g_fade_timer = NULL; g_fade_timer = NULL;
} }
static void light_fade_timer_cb(void *timer) static void light_fade_timer_cb(TimerHandle_t timer)
{ {
uint8_t red = 0; uint8_t red = 0;
uint8_t green = 0; uint8_t green = 0;

View File

@@ -4,4 +4,4 @@ targets:
description: cmux example of esp_modem description: cmux example of esp_modem
dependencies: dependencies:
espressif/esp_modem: espressif/esp_modem:
version: "0.1.9" version: "0.1.12"

View File

@@ -2870,7 +2870,6 @@ examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/ble_mesh_fas
examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/iot_led.h examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/iot_led.h
examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/iot_light.h examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/iot_light.h
examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/light_driver.h examples/bluetooth/esp_ble_mesh/common_components/light_driver/include/light_driver.h
examples/bluetooth/esp_ble_mesh/common_components/light_driver/light_driver.c
examples/bluetooth/esp_hid_device/main/esp_hid_device_main.c examples/bluetooth/esp_hid_device/main/esp_hid_device_main.c
examples/bluetooth/esp_hid_device/main/esp_hid_gap.c examples/bluetooth/esp_hid_device/main/esp_hid_gap.c
examples/bluetooth/esp_hid_device/main/esp_hid_gap.h examples/bluetooth/esp_hid_device/main/esp_hid_gap.h