Go to the documentation of this file.
21 #include <util/delay.h>
23 #if defined(EXTERNAL_APP)
27 #if defined(OS_CONFIG_SIM) && OS_CONFIG_SIM == true
30 #define DELAY_MS(ms) _delay_ms(ms)
70 for (uint64_t i = 0; i < 10; i++) {
89 for (uint64_t i = 0; i < 5; i++) {
96 assert(stat ==
E_OK && tick == 5 && eTick == 5);
108 for (uint64_t i = 0; i < 7; i++) {
115 assert(stat ==
E_OK && tick == 1 && eTick == 7);
126 assert(info.maxallowedvalue == UINT32_MAX);
127 assert(info.mincycle == 1);
128 assert(info.ticksperbase == 57);
129 assert(info.secondspertick == 0.017778);
170 }
else if (t == 20) {
172 }
else if (t == 30) {
184 for (uint8_t i = 0; i < 3; i++) {
216 for (uint8_t i = 0; i < 3; i++) {
230 for (uint8_t i = 0; i < 3; i++) {
242 for (uint8_t i = 0; i < 3; i++) {
309 for (uint8_t i = 0; i < 5; i++) {
342 assert(tick == currentTick);
352 assert(tick == currentTick);
363 assert(tick == currentTick);
377 assert(tick == currentTick);
387 assert(tick == currentTick);
398 assert(tick == currentTick);
413 assert(tick == currentTick);
431 assert(tick == currentTick);
447 assert(tick == currentTick);
463 assert(tick == currentTick);
479 assert(tick == currentTick);
493 assert(tick == currentTick);
505 assert(tick == currentTick);
529 assert(tick == currentTick);
541 assert(tick == currentTick);
558 assert(tick == currentTick);
570 assert(tick == currentTick);
671 for (uint8_t i = 0; i < 10; i++) {
683 for (uint8_t i = 0; i < 15; i++) {
710 #if defined(__AVR_ATmega32__)
711 GICR = 1 << INT0 | 1 << INT1;
712 MCUCR = 1 << ISC01 | 0 << ISC00 | 1 << ISC11 | 0 << ISC10;
713 #elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega2560__)
714 EICRA = 1 << ISC11 | 0 << ISC10 | 1 << ISC01 | 0 << ISC00;
715 EIMSK |= 1 << INT1 | 1 << INT0;
723 TCCR1B |= (1 << WGM12);
724 TCCR1B |= (1 << CS12) | (1 << CS10);
726 #if defined(__AVR_ATmega128__)
727 TIMSK |= (1 << OCIE1A);
729 TIMSK1 |= (1 << OCIE1A);
733 #if defined(OS_CONFIG_SIM) && OS_CONFIG_SIM == true
734 #if defined(__AVR_ATmega128__)
738 TCCR2B = (1 << CS20);
739 TIMSK2 |= 1 << TOIE2;
743 #error Unknown CPU defined!
762 for (uint8_t i = 0; i < 11; i++) {
enum tasks_e TaskType
Type for task reference.
uint8_t EventMaskType
Data type of the event mask.
enum ProtectionReturnType_e ProtectionReturnType
Return type for protection hook.
@ PRO_TERMINATETASKISR
Terminate faulty task or ISR.
enum StatusType_e StatusType
Type for status.
volatile struct counter_s AlarmBaseType
Type for alarm base.
#define SuspendAllInterrupts
void ErrorHook(StatusType error)
PostTask hook function.
@ HARDWARE
Counter is implemented in hardware.
#define ResumeOSInterrupts
uint64_t TickType
Data type of counter values.
enum alarm_e AlarmType
Type for alarm reference.
ProtectionReturnType ProtectionHook(StatusType fatalError)
ProtectionHook function.
#define GetActiveApplicationMode
Assert macros and functions.
@ RUNNING
The task is currently running.
const TickType maxallowedvalue
Maximum allowed value of counter.
@ SCHEDULETABLE_STOPPED
Schedule table is stopped.
void PreTaskHook(void)
PreTask hook function.
volatile uint8_t isCat2ISR
Priority of current Cat 2 ISR (zero if not in Cat 2 ISR)
volatile bool isISR
Is currently ISR context?
#define StartScheduleTableRel
#define StartScheduleTableAbs
#define assert(expression)
@ SUSPENDED
The task is suspended and will not be scheduled.
#define ResumeAllInterrupts
#define NextScheduleTable
#define SuspendOSInterrupts
#define StopScheduleTable
void PostTaskHook(void)
PostTask hook function.
enum scheduleTableState_e ScheduleTableStatusType
State of schedule table.
void ShutdownHook(StatusType error)
volatile struct counter_s * Counter_Cfg[]
Current counter control blocks.
enum OsTaskState_e TaskStateType
Task state.
@ PRO_SHUTDOWN
Shutdown system.
#define GetScheduleTableStatus
enum applicationMode_e AppModeType
Type for application mode.