This example project shows how to display state information with the Event Recorder. The application itself implements a event_state thread that is started with two instances. The event state thread itself makes state transitions that are recorded.
Source code of the event state thread (from MyEventComponent.c)
void event_state (void *argument) {
unsigned int i, h, name;
name = (unsigned int) argument;
h = name + 0x10000000;
osDelay(100);
EvrMyC1_Create (h, name);
for (i=0; i < 2; i++) {
osDelay(100);
EvrMyC1_Active (h);
osDelay(100);
EvrMyC1_Waiting (h);
osDelay(100);
EvrMyC1_Idle (h);
osDelay(100);
}
EvrMyC1_Clear (h);
osDelay(100);
EvrMyC1_Delete (h);
:
}
Start of the event state thread (from main.c)
char *name1 = "MyName1";
char *name2 = "MyName2";
osThreadId_t event_state1_id;
osThreadId_t event_state2_id;
int main (void) {
osKernelInitialize();
event_state1_id = osThreadNew(event_state, name1 , NULL);
event_state2_id = osThreadNew(event_state, name2 , NULL);
osKernelStart ();
}
The application itself uses the MyEventComponent.scvd file to describe the state. Refer to the element state for more information.
Build and run
- Open the project "SCVD Event State" from Pack Installer (search for uVision Simulator in the Boards tab).
- Compile and run the application.
- Open the windows View - Analysis Windows - Event Recorder and View - Analysis Windows - System Analyzer to verify the output.
System Analyzer with event state information
Event Recorder with event state information