Header files adjustment

(MQTT changes split from original commit - @projectgus.)
This commit is contained in:
Michael Jacobsen 2015-08-23 10:21:42 +02:00 committed by Angus Gratton
parent 0a9b491a98
commit 38d4bd0f62
3 changed files with 22 additions and 9 deletions

View file

@ -95,9 +95,9 @@ esp_open_rtos::thread::queue_t<uint32_t> MyQueue;
*/ */
extern "C" void user_init(void) 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;

View file

@ -46,14 +46,30 @@ public:
*/ */
inline mutex_t() inline mutex_t()
{ {
mutex = xSemaphoreCreateMutex(); mutex = 0;
}
/**
*
* @return
*/
inline int mutex_create()
{
mutex = xSemaphoreCreateMutex();
if(mutex == NULL) {
return -1;
}
else {
return 0;
}
} }
/** /**
* *
*/ */
inline ~mutex_t() inline void mutex_destroy()
{ {
vQueueDelete(mutex); vQueueDelete(mutex);
mutex = 0;
} }
/** /**
* *

View file

@ -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;