upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/unit/stubs/freertos/task.h
blob: 3855d4178091bab95ad5b84daef62d52f070bb8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef STUBS_FREERTOS_TASK_H
#define STUBS_FREERTOS_TASK_H

#include <stdint.h>
#include <stdlib.h>

typedef void *TaskHandle_t;
typedef void *SemaphoreHandle_t;

static inline void vTaskDelete(TaskHandle_t t) { (void)t; }
static inline SemaphoreHandle_t xSemaphoreCreateMutex(void) { return (SemaphoreHandle_t)malloc(1); }
static inline void vSemaphoreDelete(SemaphoreHandle_t s) { free(s); }
static inline int xSemaphoreTake(SemaphoreHandle_t s, uint32_t blk) { (void)s; (void)blk; return 1; }
static inline int xSemaphoreGive(SemaphoreHandle_t s) { (void)s; return 1; }
static inline int xTaskCreate(void (*fn)(void*), const char *n, uint32_t st, void *p, uint32_t pri, TaskHandle_t *h) {
    (void)fn; (void)n; (void)st; (void)p; (void)pri; (void)h; return 1;
}

#endif