summaryrefslogtreecommitdiff
path: root/n/es-2006/src/main.c
diff options
context:
space:
mode:
authordufourj2006-05-11 21:39:02 +0000
committerdufourj2006-05-11 21:39:02 +0000
commite9e974cb64950afe3bf54c82d5a047a18655b831 (patch)
tree262f27a7aa25b73b4fc7f32655e03aa3cc330a12 /n/es-2006/src/main.c
parent4d3ee19aec9942f5ef1ddcc2b0dd843cd50bf49a (diff)
ES :
RVB : - renomage de es_config en timer_1 ; - possibilité de configurer des paramètres du module RVB de façon dynamique. Autre : - ajout de la gestion du bouton de sélection de couleurs, jack et contact frontal (Patrick).
Diffstat (limited to 'n/es-2006/src/main.c')
-rw-r--r--n/es-2006/src/main.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/n/es-2006/src/main.c b/n/es-2006/src/main.c
index e95db14..b69c861 100644
--- a/n/es-2006/src/main.c
+++ b/n/es-2006/src/main.c
@@ -32,8 +32,9 @@
#include "timer_main.h" /* main timer */
#include "sensor_rvb.h" /* RVB sensors management */
-#include "es_config.h" /* timer/counter 1 */
+#include "timer_1.h" /* timer/counter 1 */
+#include "others.h" /* define game color mode + jack + frontal sensor */
/* Statistics for RVB sensors */
uint8_t sensor_rvb_stat_enable[RVB_MAX_SENSOR] = { 0 };
@@ -61,9 +62,25 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
sensor_rvb_stat_enable[compt] = sensor_rvb_stats[compt] =
args[2];
break;
-// case c ('s', 2):
-// sensor_rvb_watch (args[0], args[1]);
+ /* RVB sensors configuration */
+ case c ('R', 3):
+ sensor_rvb_config (args[0], args[1], args[2]);
+ break;
+ /* color mode game */
+ case c ('c', 0 ):
+ proto_send1b('c', others_selectcoul());
+ break;
+
+// /* contact */
+// case c ('t', 0 ):
+// proto_send1b('t', others_contact());
// break;
+//
+// /* jack */
+// case c ('j', 0 ):
+// proto_send1b('j', others_jack());
+// break;
+
/* Unknown commands */
default:
proto_send0 ('?');
@@ -88,7 +105,8 @@ main (void)
timer1_init ();
/* Init RVB sensors system */
sensor_rvb_init ();
-
+ /* Init Color button init */
+ others_init();
/* Enable interrupts */
sei ();
@@ -106,7 +124,8 @@ main (void)
{
/* Re init stats system for this sensor */
sensor_rvb_stats[compt] = sensor_rvb_stat_enable[compt];
- proto_send4w ('S', sensor_rvb_values[compt][0],
+ // FIXME useless 16 bit value.
+ proto_send5w ('S', compt, sensor_rvb_values[compt][0],
sensor_rvb_values[compt][1], sensor_rvb_values[compt][2],
sensor_rvb_values[compt][3]);
}