FreeRTOS type updates. (#261)
This commit is contained in:
parent
4c84b64566
commit
a5cc728079
53 changed files with 151 additions and 148 deletions
|
@ -34,7 +34,7 @@ As all data aqquired from the BMP180/BMP085 is provided to the `bmp180_informUse
|
|||
|
||||
```
|
||||
// Own BMP180 User Inform Implementation
|
||||
bool my_informUser(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) {
|
||||
bool my_informUser(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) {
|
||||
my_event_t ev;
|
||||
|
||||
ev.event_type = MY_EVT_BMP180;
|
||||
|
|
|
@ -214,20 +214,20 @@ bool bmp180_measure(bmp180_constants_t *c, int32_t *temperature,
|
|||
typedef struct
|
||||
{
|
||||
uint8_t cmd;
|
||||
const xQueueHandle* resultQueue;
|
||||
const QueueHandle_t* resultQueue;
|
||||
} bmp180_command_t;
|
||||
|
||||
// Just works due to the fact that xQueueHandle is a "void *"
|
||||
static xQueueHandle bmp180_rx_queue = NULL;
|
||||
static xTaskHandle bmp180_task_handle = NULL;
|
||||
// Just works due to the fact that QueueHandle_t is a "void *"
|
||||
static QueueHandle_t bmp180_rx_queue = NULL;
|
||||
static TaskHandle_t bmp180_task_handle = NULL;
|
||||
|
||||
//
|
||||
// Forward declarations
|
||||
//
|
||||
static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
|
||||
static bool bmp180_informUser_Impl(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
|
||||
|
||||
// Set default implementation .. User gets result as bmp180_result_t event
|
||||
bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) = bmp180_informUser_Impl;
|
||||
bool (*bmp180_informUser)(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) = bmp180_informUser_Impl;
|
||||
|
||||
// I2C Driver Task
|
||||
static void bmp180_driver_task(void *pvParameters)
|
||||
|
@ -295,7 +295,7 @@ static bool bmp180_createTask()
|
|||
}
|
||||
|
||||
// Default user inform implementation
|
||||
static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure)
|
||||
static bool bmp180_informUser_Impl(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure)
|
||||
{
|
||||
bmp180_result_t result;
|
||||
|
||||
|
@ -328,7 +328,7 @@ bool bmp180_init(uint8_t scl, uint8_t sda)
|
|||
return result;
|
||||
}
|
||||
|
||||
void bmp180_trigger_measurement(const xQueueHandle* resultQueue)
|
||||
void bmp180_trigger_measurement(const QueueHandle_t* resultQueue)
|
||||
{
|
||||
bmp180_command_t c;
|
||||
|
||||
|
@ -339,7 +339,7 @@ void bmp180_trigger_measurement(const xQueueHandle* resultQueue)
|
|||
}
|
||||
|
||||
|
||||
void bmp180_trigger_pressure_measurement(const xQueueHandle* resultQueue)
|
||||
void bmp180_trigger_pressure_measurement(const QueueHandle_t* resultQueue)
|
||||
{
|
||||
bmp180_command_t c;
|
||||
|
||||
|
@ -349,7 +349,7 @@ void bmp180_trigger_pressure_measurement(const xQueueHandle* resultQueue)
|
|||
xQueueSend(bmp180_rx_queue, &c, 0);
|
||||
}
|
||||
|
||||
void bmp180_trigger_temperature_measurement(const xQueueHandle* resultQueue)
|
||||
void bmp180_trigger_temperature_measurement(const QueueHandle_t* resultQueue)
|
||||
{
|
||||
bmp180_command_t c;
|
||||
|
||||
|
|
|
@ -45,16 +45,16 @@ typedef struct
|
|||
bool bmp180_init(uint8_t scl, uint8_t sda);
|
||||
|
||||
// Trigger a "complete" measurement (temperature and pressure will be valid when given to "bmp180_informUser)
|
||||
void bmp180_trigger_measurement(const xQueueHandle* resultQueue);
|
||||
void bmp180_trigger_measurement(const QueueHandle_t* resultQueue);
|
||||
|
||||
// Trigger a "temperature only" measurement (only temperature will be valid when given to "bmp180_informUser)
|
||||
void bmp180_trigger_temperature_measurement(const xQueueHandle* resultQueue);
|
||||
void bmp180_trigger_temperature_measurement(const QueueHandle_t* resultQueue);
|
||||
|
||||
// Trigger a "pressure only" measurement (only pressure will be valid when given to "bmp180_informUser)
|
||||
void bmp180_trigger_pressure_measurement(const xQueueHandle* resultQueue);
|
||||
void bmp180_trigger_pressure_measurement(const QueueHandle_t* resultQueue);
|
||||
|
||||
// Give the user the chance to create it's own handler
|
||||
extern bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
|
||||
extern bool (*bmp180_informUser)(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
|
||||
|
||||
// Calibration constants
|
||||
typedef struct
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue