remove extraneous base..
authorEugene Crosser <crosser@average.org>
Fri, 11 Dec 2015 14:38:18 +0000 (17:38 +0300)
committerEugene Crosser <crosser@average.org>
Fri, 11 Dec 2015 14:38:18 +0000 (17:38 +0300)
Pulsecounter-Prog.c
Pulsecounter.ems

index 4ac463f50a59d2986b7b44f6c4f3b25e6cef0ce1..107ad32c2aae86362ed29fa7c62628031cbefbb4 100644 (file)
@@ -4,10 +4,8 @@
 static void gpioHandler(uint8_t id);
 static void tickHandler(void);
 static bool connected = false;
-static int32_t base4 = 0;
-static int32_t base5 = 0;
-static int32_t event4 = 0;
-static int32_t event5 = 0;
+static int32_t cold = 0;
+static int32_t hot  = 0;
 
 void main() {
     Hal_init();
@@ -31,17 +29,17 @@ static void gpioHandler(uint8_t id) {
         Hal_tickStart(15000, tickHandler);
         break;
     case 1:
-        event4++;
+        cold++;
         if (connected)
-            Pulsecounter_event4_indicate();
+            Pulsecounter_coldTick_indicate();
         Hal_greenLedOn();
         Hal_delay(10);
         Hal_greenLedOff();
         break;
     case 2:
-        event5++;
+        hot++;
         if (connected)
-            Pulsecounter_event5_indicate();
+            Pulsecounter_hotTick_indicate();
         Hal_redLedOn();
         Hal_delay(10);
         Hal_redLedOff();
@@ -101,26 +99,18 @@ void Pulsecounter_disconnectHandler(void) {
     Hal_disconnected();
 }
 
-void Pulsecounter_event4_fetch(Pulsecounter_event4_t* const output) {
-    *output = base4 + event4;
+void Pulsecounter_coldTick_fetch(Pulsecounter_coldTick_t* const output) {
+    *output = cold;
 }
 
-void Pulsecounter_event5_fetch(Pulsecounter_event5_t* const output) {
-    *output = base5 + event5;
+void Pulsecounter_hotTick_fetch(Pulsecounter_hotTick_t* const output) {
+    *output = hot;
 }
 
-void Pulsecounter_base4_fetch(Pulsecounter_base4_t* const output) {
-    *output = base4;
+void Pulsecounter_coldSet_store(Pulsecounter_coldSet_t* const input) {
+    cold = *input;
 }
 
-void Pulsecounter_base4_store(Pulsecounter_base4_t* const input) {
-    base4 = *input - event4;
-}
-
-void Pulsecounter_base5_fetch(Pulsecounter_base5_t* const output) {
-    *output = base5;
-}
-
-void Pulsecounter_base5_store(Pulsecounter_base5_t* const input) {
-    base5 = *input - event5;
+void Pulsecounter_hotSet_store(Pulsecounter_hotSet_t* const input) {
+    hot = *input;
 }
index dda43d412c9220b010cc63e5cc15f54fbb1b946d..2eaffad7058031fefd9d4f53c9511ff899a30134 100644 (file)
@@ -3,20 +3,20 @@ description = "Pulsecounter";
 
 schema Pulsecounter {
 
-    int32 event4 {
+    int32 coldTick {
         indicator
     };
 
-    int32 event5 {
+    int32 hotTick {
         indicator
     };
 
-    int32 base4 {
-        readwrite
+    int32 coldSet {
+        writeonly
     };
 
-    int32 base5 {
-        readwrite
+    int32 hotSet {
+        writeonly
     };
 
 };