1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp8266/vendor/esp/FreeRTOS.h
2018-09-05 02:39:50 +02:00

46 lines
884 B
C

/*
* Copyright (C) 2018 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
* FreeRTOS to RIOT-OS adaption module
*/
#ifndef FREERTOS_H
#define FREERTOS_H
#ifndef DOXYGEN
#include "stdlib.h"
#include "mutex.h"
#include "irq.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SemaphoreHandle_t mutex_t*
static inline SemaphoreHandle_t xSemaphoreCreateMutex(void)
{
mutex_t* _tmp = malloc (sizeof(mutex_t));
mutex_init(_tmp);
return _tmp;
}
#define xSemaphoreTake(s,to) mutex_lock(s)
#define xSemaphoreGive(s) mutex_unlock(s)
#define vPortEnterCritical() int _irq_state = irq_disable ()
#define vPortExitCritical() irq_restore(_irq_state)
#ifdef __cplusplus
}
#endif
#endif // DOXYGEN
#endif /* FREERTOS_H */