65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
#ifndef TASK01_SOFTWARE_TIMERS_H
|
|
#define TASK01_SOFTWARE_TIMERS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
#include "timers.h"
|
|
#include "task01_software_timers_model.h"
|
|
|
|
#define FC06_TASK_STACK_WORDS 256U
|
|
#define FC06_CONTROLLER_PRIORITY 2U
|
|
#define FC06_VERIFIER_PRIORITY 1U
|
|
#define FC06_EVENT_CAPACITY 12U
|
|
#define FC06_TIMEOUT_TICKS 20U
|
|
|
|
typedef enum TimerKind
|
|
{
|
|
FC06_TIMER_ONE_SHOT = 1,
|
|
FC06_TIMER_AUTO = 2
|
|
} TimerKind;
|
|
|
|
typedef struct TimerTag
|
|
{
|
|
TimerKind kind;
|
|
uint32_t marker;
|
|
} TimerTag;
|
|
|
|
typedef struct TimerExperiment
|
|
{
|
|
TimerHandle_t one_shot;
|
|
TimerHandle_t automatic;
|
|
TaskHandle_t controller;
|
|
TaskHandle_t verifier;
|
|
TaskHandle_t daemon_seen;
|
|
TimerTag one_shot_tag;
|
|
TimerTag automatic_tag;
|
|
uint32_t start_accepted;
|
|
uint32_t reset_accepted;
|
|
uint32_t change_accepted;
|
|
uint32_t stop_accepted;
|
|
uint32_t one_shot_count;
|
|
uint32_t auto_count;
|
|
uint32_t one_shot_tick;
|
|
uint32_t auto_tick[ 3 ];
|
|
uintptr_t controller_sp;
|
|
uintptr_t callback_sp;
|
|
uint32_t controller_done;
|
|
uint32_t pass;
|
|
uint32_t digest;
|
|
} TimerExperiment;
|
|
|
|
extern TimerExperiment g_fc06;
|
|
extern TimerEvidence g_fc06_events[ FC06_EVENT_CAPACITY ];
|
|
extern volatile uint32_t g_fc06_event_count;
|
|
extern volatile uint32_t g_fc06_last_checkpoint;
|
|
extern volatile uint32_t g_fc06_pass;
|
|
|
|
void fc06_checkpoint_committed( uint32_t point, const void * subject );
|
|
void fc06_timer_callback( TimerHandle_t timer );
|
|
void fc06_controller_entry( void * context );
|
|
void fc06_verifier_entry( void * context );
|
|
|
|
#endif
|