summaryrefslogtreecommitdiff
path: root/n/avr/adc
diff options
context:
space:
mode:
authorschodet2005-05-03 17:06:10 +0000
committerschodet2005-05-03 17:06:10 +0000
commit1126a75ec016b0179cc05765427f5a4c463581d9 (patch)
treec2818a50c358cc349898bd5a84e29b27c7a746cf /n/avr/adc
parent74550d3214bca333dcbcd73b75a1e7b535c7e1f0 (diff)
Modification pour Taz.
Diffstat (limited to 'n/avr/adc')
-rw-r--r--n/avr/adc/avrconfig.h2
-rw-r--r--n/avr/adc/test_adc.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/n/avr/adc/avrconfig.h b/n/avr/adc/avrconfig.h
index b33b768..dcf1e47 100644
--- a/n/avr/adc/avrconfig.h
+++ b/n/avr/adc/avrconfig.h
@@ -61,6 +61,6 @@
#define AC_PROTO_PUTC rs232_putc
#define SIZE_BUF_RCPT 1
-#define SIZE_BUF_SEND 6
+#define SIZE_BUF_SEND 10
#endif /* avrconfig_h */
diff --git a/n/avr/adc/test_adc.c b/n/avr/adc/test_adc.c
index 0e2d5f7..1844411 100644
--- a/n/avr/adc/test_adc.c
+++ b/n/avr/adc/test_adc.c
@@ -58,7 +58,9 @@ proto_putc (uint8_t c)
int
main (void)
{
- uint16_t adc[3];
+ uint16_t adc[5];
+ static const uint8_t adc_pos[5] =
+ { 0, 1, 2, 4, 5 };
int i;
go = 0;
rs232_init ();
@@ -69,22 +71,22 @@ main (void)
while (1)
{
/* Démarre une acquisition de mesure sur l'adc 0. */
- for (i = 0; i < 3; i ++)
+ for (i = 0; i < 5; i ++)
{
- adc_start (i);
+ adc_start (adc_pos[i]);
/* Attente active sur adc jusqu'a ce que la valeur soit
* disponible. */
while (adc_checkf())
;
- delay_us (250L);
+ delay_ms (20L);
/* Lit l'adc. */
adc[i] = adc_read();
}
/* Lit la valeur puis l'envoit. */
if (go)
- proto_send3w ('m', adc[0], adc[1], adc[2]);
- twi_update ((uint8_t *) adc, 6);
+ proto_send5w ('m', adc[0], adc[1], adc[2], adc[3], adc[4]);
+ twi_update ((uint8_t *) adc, 10);
if (rs232_poll ())
proto_accept (rs232_getc ());
}