Commit 5fb2441a authored by ch3's avatar ch3
Browse files

feat(epicardium api): Set GPIO pins for evaluating timings

parent e9ca7b4d
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
void *_api_call_start(api_id_t id, uintptr_t size) void *_api_call_start(api_id_t id, uintptr_t size)
{ {
GPIO_OutSet(&debug_pin_1);
while (SEMA_GetSema(_API_SEMAPHORE) == E_BUSY) { while (SEMA_GetSema(_API_SEMAPHORE) == E_BUSY) {
} }
...@@ -32,6 +33,7 @@ void *_api_call_transact(void *buffer) ...@@ -32,6 +33,7 @@ void *_api_call_transact(void *buffer)
API_CALL_MEM->call_flag = _API_FLAG_CALLING; API_CALL_MEM->call_flag = _API_FLAG_CALLING;
SEMA_FreeSema(_API_SEMAPHORE); SEMA_FreeSema(_API_SEMAPHORE);
GPIO_OutSet(&debug_pin_0);
/* Notify the dispather of the new call */ /* Notify the dispather of the new call */
__SEV(); __SEV();
__WFE(); __WFE();
......
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "gpio.h"
/* /*
* Semaphore used for API synchronization. * Semaphore used for API synchronization.
...@@ -7,6 +8,10 @@ ...@@ -7,6 +8,10 @@
*/ */
#define _API_SEMAPHORE 0 #define _API_SEMAPHORE 0
static const gpio_cfg_t debug_pin_0 = {PORT_0, PIN_22, GPIO_FUNC_OUT, GPIO_PAD_NONE};
static const gpio_cfg_t debug_pin_1 = {PORT_0, PIN_21, GPIO_FUNC_OUT, GPIO_PAD_NONE};
/* Type of API IDs */ /* Type of API IDs */
typedef uint32_t api_id_t; typedef uint32_t api_id_t;
......
...@@ -55,6 +55,8 @@ api_id_t api_dispatcher_exec() ...@@ -55,6 +55,8 @@ api_id_t api_dispatcher_exec()
return 0; return 0;
} }
GPIO_OutClr(&debug_pin_1);
api_id_t id = API_CALL_MEM->id; api_id_t id = API_CALL_MEM->id;
__api_dispatch_call(id, API_CALL_MEM->buffer); __api_dispatch_call(id, API_CALL_MEM->buffer);
API_CALL_MEM->call_flag = _API_FLAG_RETURNED; API_CALL_MEM->call_flag = _API_FLAG_RETURNED;
......
...@@ -29,6 +29,7 @@ void pre_idle_sleep(TickType_t xExpectedIdleTime) ...@@ -29,6 +29,7 @@ void pre_idle_sleep(TickType_t xExpectedIdleTime)
__asm volatile("dsb" ::: "memory"); __asm volatile("dsb" ::: "memory");
__asm volatile("wfe"); __asm volatile("wfe");
__asm volatile("isb"); __asm volatile("isb");
GPIO_OutClr(&debug_pin_0);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment