Skip to content

Commit

Permalink
Update sensor data publisher module
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-yolabs committed Jul 20, 2023
1 parent 61c3f7c commit e23142a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extra/example/module_sensor_data_publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ static SensorDataEvent_t s_event = {

void SensorDataPublisher_GenerateData()
{
if (!ErEventIsInFlight(&s_event.m_event))
#ifdef ER_CONFIG_OS
if (ErTryClaim(TO_ER_EVENT(s_event)))
#endif
{
s_event.m_temperature_c = rand() % 100;
s_event.m_lux = rand() % 50;
Expand Down

0 comments on commit e23142a

Please sign in to comment.