-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#63 - Mocked more I/O - hw_interrupt_queue builds for Linux.
- Loading branch information
1 parent
bd7ed05
commit c733195
Showing
8 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <driver/gpio.h> | ||
#include <esp_err.h> | ||
|
||
esp_err_t gpio_isr_handler_add(gpio_num_t /*gpio_num*/, gpio_isr_t /*isr_handler*/, void* args) | ||
{ | ||
return ESP_OK; | ||
} | ||
|
||
esp_err_t gpio_config(const gpio_config_t* /*pGPIOConfig*/) | ||
{ | ||
return ESP_OK; | ||
} | ||
|
||
int gpio_get_level(gpio_num_t /*gpio_num*/) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#pragma once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#define portCHAR int8_t | ||
#define portFLOAT float | ||
#define portDOUBLE double | ||
#define portLONG int32_t | ||
#define portSHORT int16_t | ||
#define portSTACK_TYPE uint8_t | ||
#define portBASE_TYPE int | ||
|
||
typedef portSTACK_TYPE StackType_t; | ||
typedef portBASE_TYPE BaseType_t; | ||
typedef unsigned portBASE_TYPE UBaseType_t; | ||
|
||
typedef uint32_t TickType_t; | ||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
/* Converts a time in milliseconds to a time in ticks. */ | ||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( ( TickType_t ) ( xTimeInMs ) * configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) | ||
|
||
#define pdFALSE ( ( BaseType_t ) 0 ) | ||
#define pdTRUE ( ( BaseType_t ) 1 ) | ||
|
||
#define pdPASS ( pdTRUE ) | ||
#define pdFAIL ( pdFALSE ) | ||
#define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) | ||
#define errQUEUE_FULL ( ( BaseType_t ) 0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include "portmacro.h" | ||
#include "projdefs.h" | ||
|
||
#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U ) | ||
#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U ) | ||
#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U ) | ||
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U ) | ||
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U ) | ||
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U ) | ||
|
||
#define queueSEND_TO_BACK ( ( BaseType_t ) 0 ) | ||
#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 ) | ||
#define queueOVERWRITE ( ( BaseType_t ) 2 ) | ||
|
||
typedef void* QueueHandle_t; | ||
|
||
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ); | ||
|
||
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength, | ||
const UBaseType_t uxItemSize, | ||
const uint8_t ucQueueType ); | ||
|
||
BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, | ||
const void* const pvItemToQueue, | ||
BaseType_t* const pxHigherPriorityTaskWoken, | ||
const BaseType_t xCopyPosition ); | ||
|
||
BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t* const pxHigherPriorityTaskWoken ); | ||
|
||
BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void* const pvBuffer, | ||
BaseType_t* const pxHigherPriorityTaskWoken ); | ||
|
||
#define xQueueCreate( uxQueueLength, \ | ||
uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) ) | ||
|
||
#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, \ | ||
pxHigherPriorityTaskWoken ) \ | ||
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK ) | ||
|
||
#define xQueueReceive( xQueue, pvBuffer, \ | ||
xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE ) | ||
|
||
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, | ||
void* const pvBuffer, | ||
TickType_t xTicksToWait, | ||
const BaseType_t xJustPeek ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <freertos/queue.h> | ||
|
||
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t /*xQueue*/ ) | ||
{ | ||
return 0; | ||
} | ||
|
||
QueueHandle_t xQueueGenericCreate( const UBaseType_t /*uxQueueLength*/, const UBaseType_t /*uxItemSize*/, | ||
const uint8_t /*ucQueueType*/ ) | ||
{ | ||
return nullptr; | ||
} | ||
|
||
BaseType_t xQueueGenericSendFromISR( QueueHandle_t /*xQueue*/, | ||
const void* const /*pvItemToQueue*/, | ||
BaseType_t* const /*pxHigherPriorityTaskWoken*/, | ||
const BaseType_t /*xCopyPosition*/ ) | ||
{ | ||
return pdPASS; | ||
} | ||
|
||
BaseType_t xQueueGiveFromISR( QueueHandle_t /*xQueue*/, BaseType_t* const /*pxHigherPriorityTaskWoken*/) | ||
{ | ||
return pdPASS; | ||
} | ||
|
||
BaseType_t xQueueReceiveFromISR( QueueHandle_t /*xQueue*/, void* const /*pvBuffer*/, | ||
BaseType_t* const /*pxHigherPriorityTaskWoken*/ ) | ||
{ | ||
return pdFAIL; | ||
} | ||
|
||
BaseType_t xQueueGenericReceive( QueueHandle_t /*xQueue*/, | ||
void* const /*pvBuffer*/, | ||
TickType_t /*xTicksToWait*/, | ||
const BaseType_t /*xJustPeek*/ ) | ||
{ | ||
return pdFAIL; | ||
} |