feat: publish FreeRTOS C FC02 card
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "task01_first_task.h"
|
||||
|
||||
_Static_assert( offsetof( WorkerContext, id ) == 0U,
|
||||
"worker id must be the first debugger-visible field" );
|
||||
_Static_assert( sizeof( ( ( WorkerContext * ) 0 )->handle ) == sizeof( TaskHandle_t ),
|
||||
"the public handle must retain the FreeRTOS ABI type" );
|
||||
|
||||
/* Deliberately unsafe compile-only exhibit: C accepts this wrong cast. */
|
||||
WorkerContext * task01_wrong_context_cast_exhibit( void * supervisor )
|
||||
{
|
||||
return ( WorkerContext * ) supervisor;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "task01_workload.h"
|
||||
|
||||
int main( void )
|
||||
{
|
||||
uint32_t result = 0U;
|
||||
uint32_t value;
|
||||
|
||||
for( value = 1U; value <= TASK01_WORK_LIMIT; ++value )
|
||||
{
|
||||
result = task01_accumulate( result, value );
|
||||
}
|
||||
|
||||
return result == TASK01_EXPECTED_SUM ? 0 : 1;
|
||||
}
|
||||
Reference in New Issue
Block a user