Skip to content

Commit

Permalink
[SMCO] Add mExpressedStatePriority
Browse files Browse the repository at this point in the history
  • Loading branch information
hare-siterwell committed Jul 4, 2023
1 parent 4279d22 commit 75c0385
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 183 deletions.
26 changes: 24 additions & 2 deletions examples/smoke-co-alarm-app/silabs/include/SmokeCoAlarmManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#pragma once

#include <map>
#include <stdbool.h>
#include <stdint.h>

Expand All @@ -42,6 +41,12 @@ class SmokeCoAlarmManager
*/
bool StartSelfTesting();

/**
* @brief Execute the HandleEventTrigger process
*
*/
bool StartHandleEventTrigger(uint64_t eventTrigger);

/**
* @brief Updates the expressed state with new value
*
Expand All @@ -59,7 +64,24 @@ class SmokeCoAlarmManager
* @brief Record expressed state in decreasing priority
*
*/
std::map<ExpressedStateEnum, bool> mExpressedState;
std::array<ExpressedStateEnum, 9> mExpressedStatePriority;

/**
* @brief Expression status record values
*
*/
int mExpressedStateMask = 1;

bool mSelfTesting;
bool mHandleEventTrigger;
uint64_t mEventTrigger;

void CancelTimer(void);
void StartTimer(uint32_t aTimeoutMs);

static void TimerEventHandler(TimerHandle_t xTimer);
static void SelfTestingTimerEventHandler(AppEvent * aEvent);
static void EventTriggerTimerEventHandler(AppEvent * aEvent);

static SmokeCoAlarmManager sAlarm;
};
Expand Down
Loading

0 comments on commit 75c0385

Please sign in to comment.