From 2eb565564f5ff9b7d68cfd728ba8db491ffd69b4 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 26 Mar 2015 19:32:05 +0100 Subject: [PATCH] tests: fix test programs using old uart API The uart API changed and these tests were not adapted: the first parameter is now the UART port number. Signed-off-by: Olivier Matz --- modules/comm/uart/test/main.c | 2 +- .../brushless_3phase_digital_hall/test/main.c | 2 +- .../test/main.c | 2 +- .../control_system/filters/biquad/test/main.c | 2 +- .../filters/quadramp_derivate/test/main.c | 2 +- modules/ihm/parse/test/main.c | 2 +- modules/ihm/rdline/test/main.c | 4 ++-- projects/example2/main.c | 4 ++-- projects/kbd_uart_test/main.c | 14 +++++++------- projects/microb2010/tests/test_board2008/action.c | 6 +++--- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/comm/uart/test/main.c b/modules/comm/uart/test/main.c index 23ed2f0..381b57c 100644 --- a/modules/comm/uart/test/main.c +++ b/modules/comm/uart/test/main.c @@ -76,7 +76,7 @@ int main(void) #ifndef HOST_VERSION /* now we want to do a printf : we must register the - * uart0_send as stdout. Here no receive function is + * uart0_dev_send as stdout. Here no receive function is * specified. */ fdevopen(uart0_dev_send, NULL); #endif diff --git a/modules/devices/brushless_motors/brushless_3phase_digital_hall/test/main.c b/modules/devices/brushless_motors/brushless_3phase_digital_hall/test/main.c index 5e5cc9a..d804908 100644 --- a/modules/devices/brushless_motors/brushless_3phase_digital_hall/test/main.c +++ b/modules/devices/brushless_motors/brushless_3phase_digital_hall/test/main.c @@ -111,7 +111,7 @@ int main(void) uart_init(); - fdevopen((void *)uart0_send,NULL,0); + fdevopen((void *)uart0_dev_send, NULL,0); printf_P(PSTR("\nbonjour\n")); sei(); diff --git a/modules/devices/brushless_motors/brushless_3phase_digital_hall_double/test/main.c b/modules/devices/brushless_motors/brushless_3phase_digital_hall_double/test/main.c index aaebd2e..1c4d14e 100644 --- a/modules/devices/brushless_motors/brushless_3phase_digital_hall_double/test/main.c +++ b/modules/devices/brushless_motors/brushless_3phase_digital_hall_double/test/main.c @@ -137,7 +137,7 @@ int main(void) uart_init(); - fdevopen((void *)uart0_send,NULL,0); + fdevopen((void *)uart0_devsend, NULL,0); printf_P(PSTR("\nbonjour\n")); sei(); diff --git a/modules/devices/control_system/filters/biquad/test/main.c b/modules/devices/control_system/filters/biquad/test/main.c index ba64fe7..6741657 100644 --- a/modules/devices/control_system/filters/biquad/test/main.c +++ b/modules/devices/control_system/filters/biquad/test/main.c @@ -41,7 +41,7 @@ int main(void) // init uart uart_init(); - fdevopen(uart0_send,NULL, 0); + fdevopen(uart0_dev_send, NULL, 0); diff --git a/modules/devices/control_system/filters/quadramp_derivate/test/main.c b/modules/devices/control_system/filters/quadramp_derivate/test/main.c index 8850d4a..f721508 100644 --- a/modules/devices/control_system/filters/quadramp_derivate/test/main.c +++ b/modules/devices/control_system/filters/quadramp_derivate/test/main.c @@ -87,7 +87,7 @@ int main(void) // init uart uart_init(); - fdevopen((void *)uart0_send,NULL,0); + fdevopen((void *)uart0_dev_send, NULL,0); diff --git a/modules/ihm/parse/test/main.c b/modules/ihm/parse/test/main.c index 64173f2..c370c1e 100644 --- a/modules/ihm/parse/test/main.c +++ b/modules/ihm/parse/test/main.c @@ -56,7 +56,7 @@ write_char(char c) { void write_char(char c) { - uart0_send(c); + uart_send(0, c); } #endif diff --git a/modules/ihm/rdline/test/main.c b/modules/ihm/rdline/test/main.c index 1165fb0..a029489 100644 --- a/modules/ihm/rdline/test/main.c +++ b/modules/ihm/rdline/test/main.c @@ -103,7 +103,7 @@ write_char(char c) { #else void write_char(char c) { - uart0_send(c); + uart_send(0, c); } static void @@ -206,7 +206,7 @@ int main(void) wait_ms(5000); printf("Start\n"); - uart0_register_rx_event(rx); + uart_register_rx_event(0, rx); sei(); #endif diff --git a/projects/example2/main.c b/projects/example2/main.c index da4134f..4faad5f 100644 --- a/projects/example2/main.c +++ b/projects/example2/main.c @@ -105,8 +105,8 @@ int main(void) u08 tab2[4]; #ifndef HOST_VERSION -/* uart_init(); */ -/* fdevopen((int (*)(char))uart0_send,(int (*)(void))uart0_recv,0); */ + uart_init(); + fdevopen(uart0_dev_send, NULL, 0); #endif my_list_type my_list ; my_another_list_type another_list ; diff --git a/projects/kbd_uart_test/main.c b/projects/kbd_uart_test/main.c index 35c66ef..b662669 100644 --- a/projects/kbd_uart_test/main.c +++ b/projects/kbd_uart_test/main.c @@ -23,7 +23,7 @@ void process(uint8_t c) tab[0] = 0; - uart0_send(c); + uart_send(0, c); if(c=='\r') { @@ -158,7 +158,7 @@ int main(void) // kbd_register_event(menu_control); /* appele la fonction process a chaque reception de caractere */ - // uart0_register_rx_event(process); + // uart_register_rx_event(0, process); /* creation du device uart */ fdevopen(uart0_dev_send,uart0_dev_recv); @@ -205,15 +205,15 @@ int main(void) { /* wait_ms(1); */ -/* uart0_send(0x00); */ +/* uart_send(0, 0x00); */ /* wait_ms(1); */ -/* uart0_send(0x03); */ +/* uart_send(0, 0x03); */ /* wait_ms(1); */ -/* uart0_send(0xAA); */ +/* uart_send(0, 0xAA); */ /* wait_ms(1); */ -/* uart0_send(0x55); */ +/* uart_send(0, 0x55); */ /* wait_ms(1); */ -/* uart0_send(0xFF); */ +/* uart_send(0, 0xFF); */ /* wait_ms(1); */ /* wait_ms(1); */ printf("\r\n>> Time set to %d seconds\r\n",time_get_s()); diff --git a/projects/microb2010/tests/test_board2008/action.c b/projects/microb2010/tests/test_board2008/action.c index 2b3917e..12882f0 100644 --- a/projects/microb2010/tests/test_board2008/action.c +++ b/projects/microb2010/tests/test_board2008/action.c @@ -40,7 +40,7 @@ void action_init(void) */ void action_servo_set(uint8_t num, uint16_t us) { - uart1_send(num); - uart1_send(0x40 | (us&0x3F)); - uart1_send(0x80 | ((us>>6)&0x3F)); + uart_send(1, num); + uart_send(1, 0x40 | (us&0x3F)); + uart_send(1, 0x80 | ((us>>6)&0x3F)); } -- 2.39.5