From fd2e238d995e206222c6ba1852aa1ac9b4783765 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Mon, 4 Jun 2012 17:41:12 +0200 Subject: [PATCH] The __delay_cycles() function in the latest mspgcc takes an unsigned long argument but does not allow it to be larger than 65536. --- platform/exp5438/clock.c | 2 +- platform/exp5438/hal_lcd.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/exp5438/clock.c b/platform/exp5438/clock.c index f701af9b7..4d0896ba9 100644 --- a/platform/exp5438/clock.c +++ b/platform/exp5438/clock.c @@ -201,7 +201,7 @@ clock_delay(unsigned int i) /*---------------------------------------------------------------------------*/ #ifdef __GNUC__ void -__delay_cycles(int c) +__delay_cycles(unsigned long c) { c /= 4; asm("add #-1, r15"); diff --git a/platform/exp5438/hal_lcd.c b/platform/exp5438/hal_lcd.c index e2475010f..fdaf32203 100644 --- a/platform/exp5438/hal_lcd.c +++ b/platform/exp5438/hal_lcd.c @@ -381,7 +381,12 @@ void halLcdActive(void) // Wait a minimum of 25ms after issuing "start oscillation" // command (to accomodate for MCLK up to 25MHz) - __delay_cycles(250000); + { + int i; + for(i = 0; i < 5; ++i) { + __delay_cycles(50000); + } + } LcdInitMacro[3 * 6 + 5] |= BIT3; LcdInitMacro[3 * 6 + 5] &= ~BIT0;