static int32_t cold = 0;
static int32_t hot = 0;
static bool connected = false;
-static bool updatable = false;
void main() {
Hal_init();
switch (id) {
case 0:
/* Pulsecounter_accept(true); */
- updatable = true;
if (connected) {
Pulsecounter_coldTick_indicate();
Hal_delay(100);
Hal_delay(50);
Hal_greenLedOff();
}
- updatable = false;
/* Pulsecounter_accept(false); */
}
void Pulsecounter_disconnectHandler(void) {
connected = false;
- updatable = false;
Hal_greenLedOn();
Hal_delay(100);
Hal_greenLedOff();
void Pulsecounter_hotTick_fetch(Pulsecounter_hotTick_t* const output) {
*output = hot;
}
-
-void Pulsecounter_coldSet_store(Pulsecounter_coldSet_t* const input) {
- Hal_greenLedOn();
- Hal_delay(100);
- Hal_greenLedOff();
- Hal_delay(100);
- Hal_greenLedOn();
- Hal_delay(100);
- Hal_greenLedOff();
- // if (updatable)
- cold = *input;
-}
-
-void Pulsecounter_hotSet_store(Pulsecounter_hotSet_t* const input) {
- Hal_redLedOn();
- Hal_delay(100);
- Hal_redLedOff();
- Hal_delay(100);
- Hal_redLedOn();
- Hal_delay(100);
- Hal_redLedOff();
- // if (updatable)
- hot = *input;
-}