From fecb5e7bdb9b8d93460cb7120578cbe5418ad5a7 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Sat, 13 Mar 2010 07:30:47 -0500 Subject: [PATCH] many warning cleanups. Contributed by Clive Stubbings. --- board/redbee-econotag.h | 2 +- board/redbee-usb.h | 6 +++--- lib/maca.c | 12 ++++++------ tests/blink-blue.c | 4 ++-- tests/blink-green.c | 4 ++-- tests/blink-red.c | 4 ++-- tests/blink-white.c | 5 +++-- tests/per.c | 10 +++++----- tests/printf.c | 2 +- tests/tests.c | 4 ++-- tests/uart1-loopback.c | 1 - 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/board/redbee-econotag.h b/board/redbee-econotag.h index fb095faf1..4975a898c 100644 --- a/board/redbee-econotag.h +++ b/board/redbee-econotag.h @@ -3,7 +3,7 @@ #define LED_RED 12 #define LED_GREEN 21 -#define LED_BLUE 35 +#define LED_BLUE 0 /* FIXME: Was 35 - in high GPIO bank so it doesn't work */ /* XTAL TUNE parameters */ /* see http://devl.org/pipermail/mc1322x/2009-December/000162.html */ diff --git a/board/redbee-usb.h b/board/redbee-usb.h index c9d786a8b..893eaa5fa 100644 --- a/board/redbee-usb.h +++ b/board/redbee-usb.h @@ -1,9 +1,9 @@ #ifndef BOARD_REDBEE_DEV_H #define BOARD_REDBEE_DEV_H -#define LED_RED (1 << 23) -#define LED_GREEN (1 << 24) -#define LED_BLUE (1 << 25) +#define LED_RED 23 +#define LED_GREEN 24 +#define LED_BLUE 25 /* XTAL TUNE parameters */ /* see http://devl.org/pipermail/mc1322x/2009-December/000162.html */ diff --git a/lib/maca.c b/lib/maca.c index 094724e9b..a25b820cd 100644 --- a/lib/maca.c +++ b/lib/maca.c @@ -70,29 +70,29 @@ void Print_Packets(char *s) { int i = 0; printf("packet pool after %s:\n\r",s); p = free_head; - printf("free_head: 0x%x ",free_head); + printf("free_head: 0x%x ", (uint32_t) free_head); while(p != 0) { i++; p = p->left; - printf("->0x%x",p); + printf("->0x%x", (uint32_t) p); } printf("\n\r"); p = tx_head; - printf("tx_head: 0x%x ",tx_head); + printf("tx_head: 0x%x ", (uint32_t) tx_head); while(p != 0) { i++; p = p->left; - printf("->0x%x",p); + printf("->0x%x", (uint32_t) p); } printf("\n\r"); p = rx_head; - printf("rx_head: 0x%x ",rx_head); + printf("rx_head: 0x%x ", (uint32_t) rx_head); while(p != 0) { i++; p = p->left; - printf("->0x%x",p); + printf("->0x%x", (uint32_t) p); } printf("\n\r"); printf("found %d packets\n\r",i); diff --git a/tests/blink-blue.c b/tests/blink-blue.c index a9410cd01..34f78e558 100644 --- a/tests/blink-blue.c +++ b/tests/blink-blue.c @@ -8,11 +8,11 @@ void main(void) { volatile uint32_t i; - *GPIO_PAD_DIR0 = ( 1<< LED ); + *GPIO_PAD_DIR0 = LED; while(1) { - *GPIO_DATA0 = (1 << LED ); + *GPIO_DATA0 = LED; for(i=0; i #include +#include "led.h" #define DELAY 400000 @@ -8,11 +9,11 @@ void main(void) { volatile uint32_t i; - *GPIO_PAD_DIR0 = ( 1<< LED ); + *GPIO_PAD_DIR0 = LED; while(1) { - *GPIO_DATA0 = (1 << LED ); + *GPIO_DATA0 = LED; for(i=0; iaddr; free_packet(p); /* pick a new address if someone else is using ours */ diff --git a/tests/printf.c b/tests/printf.c index 10cbd4d1c..7208bdb55 100644 --- a/tests/printf.c +++ b/tests/printf.c @@ -27,7 +27,7 @@ int main(void) printf("hex %x = ff\n", 0xff); printf("hex %02x = 00\n", 0); printf("signed %d = unsigned %u = hex %x\n", -3, -3, -3); - printf("%d %s(s)%", 0, "message"); + printf("%d %s(s)", 0, "message"); printf("\n"); printf("%d %s(s) with %%\n", 0, "message"); // sprintf(buf, "justif: \"%-10s\"\n", "left"); printf("%s", buf); diff --git a/tests/tests.c b/tests/tests.c index bd64642c6..5d6639d96 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -35,9 +35,9 @@ void dump_regs(uint32_t base, uint32_t len) { printf("base +0 +4 +8 +c +10 +14 +18 +1c \n\r"); for (i = 0; i < len; i ++) { if ((i & 7) == 0) { - printf("%02x",4 * i); + printf("%02x",(uint32_t)(4 * i)); } - printf(" %08x",*mem32(base+(4*i))); + printf(" %08x",(uint32_t)*mem32(base+(4*i))); if ((i & 7) == 7) printf(NL); } diff --git a/tests/uart1-loopback.c b/tests/uart1-loopback.c index 38d135427..e8d63b0ef 100644 --- a/tests/uart1-loopback.c +++ b/tests/uart1-loopback.c @@ -5,7 +5,6 @@ #include "config.h" void main(void) { - volatile char c; uart1_init(INC,MOD,SAMP);