summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
Diffstat (limited to 'n')
-rw-r--r--n/avr/adc/test_adc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/n/avr/adc/test_adc.c b/n/avr/adc/test_adc.c
index 1844411..8ffa4a5 100644
--- a/n/avr/adc/test_adc.c
+++ b/n/avr/adc/test_adc.c
@@ -45,6 +45,9 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
case 'm':
go = 1;
break;
+ default:
+ proto_send0 ('?');
+ return;
}
proto_send (cmd, size, args);
}
@@ -58,9 +61,9 @@ proto_putc (uint8_t c)
int
main (void)
{
- uint16_t adc[5];
- static const uint8_t adc_pos[5] =
- { 0, 1, 2, 4, 5 };
+ uint16_t adc[6];
+ static const uint8_t adc_pos[6] =
+ { 0, 1, 2, 4, 5, 6 };
int i;
go = 0;
rs232_init ();
@@ -71,7 +74,7 @@ main (void)
while (1)
{
/* Démarre une acquisition de mesure sur l'adc 0. */
- for (i = 0; i < 5; i ++)
+ for (i = 0; i < 6; i ++)
{
adc_start (adc_pos[i]);
/* Attente active sur adc jusqu'a ce que la valeur soit
@@ -85,8 +88,8 @@ main (void)
/* Lit la valeur puis l'envoit. */
if (go)
- proto_send5w ('m', adc[0], adc[1], adc[2], adc[3], adc[4]);
- twi_update ((uint8_t *) adc, 10);
+ proto_send ('m', 12, adc);
+ twi_update ((uint8_t *) adc, 12);
if (rs232_poll ())
proto_accept (rs232_getc ());
}