Select Git revision
aborted-computation.cc
aborted-computation.cc 797 B
#include "os.h"
#include "syscall.h"
#include "timing.h"
TIMING_MAKE_OS_MAIN( StartOS(0) )
DeclareTask(Control);
DeclareTask(Computation);
DeclareEvent(ComputationFinished);
DeclareEvent(ComputationAborted);
GENERATE_TIME_CONSUMER(computation, 5000)
TASK(Control) {
timing_start(0);
ActivateTask(Computation);
WaitEvent(ComputationFinished | ComputationAborted);
timing_end(TIMING_POINT_NO_INTERRUPTS_IN_BLOCK | 0);
/* ABB Split Point */
DisableAllInterrupts();
EnableAllInterrupts();
timing_dump();
ShutdownMachine();
TerminateTask();
}
TASK(Computation) {
computation();
SetEvent(Control, ComputationFinished);
TerminateTask();
}
ISR2(Abort) {
SetEvent(Control, ComputationAborted);
}
void PreIdleHook() {
timing_dump();
}