Header files adjustment
(MQTT changes split from original commit - @projectgus.)
This commit is contained in:
parent
0a6722840c
commit
78b006e6d3
3 changed files with 22 additions and 9 deletions
|
@ -97,7 +97,7 @@ extern "C" void user_init(void)
|
||||||
{
|
{
|
||||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||||
|
|
||||||
MyQueue.create(10);
|
MyQueue.queue_create(10);
|
||||||
|
|
||||||
task_1.queue = MyQueue;
|
task_1.queue = MyQueue;
|
||||||
task_2.queue = MyQueue;
|
task_2.queue = MyQueue;
|
||||||
|
|
|
@ -45,15 +45,31 @@ public:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline mutex_t()
|
inline mutex_t()
|
||||||
|
{
|
||||||
|
mutex = 0;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
inline int mutex_create()
|
||||||
{
|
{
|
||||||
mutex = xSemaphoreCreateMutex();
|
mutex = xSemaphoreCreateMutex();
|
||||||
|
|
||||||
|
if(mutex == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline ~mutex_t()
|
inline void mutex_destroy()
|
||||||
{
|
{
|
||||||
vQueueDelete(mutex);
|
vQueueDelete(mutex);
|
||||||
|
mutex = 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
* @param uxItemSize
|
* @param uxItemSize
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
inline int create(unsigned portBASE_TYPE uxQueueLength)
|
inline int queue_create(unsigned portBASE_TYPE uxQueueLength)
|
||||||
{
|
{
|
||||||
queue = xQueueCreate(uxQueueLength, sizeof(Data));
|
queue = xQueueCreate(uxQueueLength, sizeof(Data));
|
||||||
|
|
||||||
|
@ -69,11 +69,8 @@ public:
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param data
|
|
||||||
* @param ms
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
inline void destroy()
|
inline void queue_destroy()
|
||||||
{
|
{
|
||||||
vQueueDelete(queue);
|
vQueueDelete(queue);
|
||||||
queue = 0;
|
queue = 0;
|
||||||
|
|
Loading…
Reference in a new issue