summaryrefslogtreecommitdiff
path: root/n/es-2006/src/main.c
diff options
context:
space:
mode:
authordufourj2006-05-10 00:10:50 +0000
committerdufourj2006-05-10 00:10:50 +0000
commita4266f564c72cbf02266eebea6989b6cb2cbe7e7 (patch)
treec4ee261deff4b4def4a3e943b72c64fdd5173643 /n/es-2006/src/main.c
parente7fb4f1b6b94fbcbaf56bbd350e4d45c1d7eef39 (diff)
ES (RVB) :
- correction d'un bug dans la machine a états des capteurs RVB ; - fonctionne avec deux capteurs RVB simultanément !
Diffstat (limited to 'n/es-2006/src/main.c')
-rw-r--r--n/es-2006/src/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/n/es-2006/src/main.c b/n/es-2006/src/main.c
index f5e15a8..e95db14 100644
--- a/n/es-2006/src/main.c
+++ b/n/es-2006/src/main.c
@@ -28,6 +28,7 @@
#include "modules/uart/uart.h"
#include "modules/proto/proto.h"
#include "modules/utils/utils.h"
+#include "modules/utils/byte.h"
#include "timer_main.h" /* main timer */
#include "sensor_rvb.h" /* RVB sensors management */
@@ -43,6 +44,7 @@ void
proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
{
uint8_t compt;
+ uint16_t temp_16b;
/* This macro combine command and size in one integer. */
#define c(cmd, size) (cmd << 8 | size)
switch (c (cmd, size))
@@ -53,14 +55,11 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
break;
/* RVB sensors stats */
case c ('S', 3):
+ temp_16b = v8_to_v16 (args[0], args[1]);
for (compt = 0; compt < RVB_MAX_SENSOR; compt++)
- // TODO improve this !
- if ( ((compt >= 8) && (args[0] & _BV(compt)))
- || ((compt < 8) && (args[1] & _BV(compt))) )
- {
+ if (temp_16b & _BV(compt))
sensor_rvb_stat_enable[compt] = sensor_rvb_stats[compt] =
args[2];
- }
break;
// case c ('s', 2):
// sensor_rvb_watch (args[0], args[1]);