/*
* Very small delay: each loop takes 3 cycles.
*/
-void NAKED __delay(unsigned long iterations)
+void NAKED lm3s_busyWait(unsigned long iterations)
{
register uint32_t __n asm("r0") = iterations;
HWREG(SYSCTL_RCC) = rcc;
HWREG(SYSCTL_RCC) = rcc2;
- __delay(16);
+ lm3s_busyWait(16);
/*
* Step #2: select the crystal value (XTAL) and oscillator source
HWREG(SYSCTL_RCC) = rcc;
HWREG(SYSCTL_RCC) = rcc2;
- __delay(16);
+ lm3s_busyWait(16);
/*
* Step #3: select the desired system divider (SYSDIV) in RCC/RCC2 and
HWREG(SYSCTL_RCC) = rcc;
- __delay(16);
+ lm3s_busyWait(16);
}
/* Crystal frequency attached to the main oscillator. */
#define XTAL_FREQ SYSCTL_RCC_XTAL_8MHZ
-extern void __delay(unsigned long iterations);
+extern void lm3s_busyWait(unsigned long iterations);
unsigned long clock_get_rate(void);
void clock_set_rate(void);
#include <cfg/cfg_debug.h>
#include <cfg/macros.h> /* for BV() */
-#include <drv/clock_lm3s.h> /* __delay() */
+#include <drv/clock_lm3s.h> /* lm3s_busyWait() */
#include <drv/gpio_lm3s.h>
#include <io/lm3s.h>
#include "kdebug_lm3s.h"
/* Enable the peripheral clock */
SYSCTL_RCGC1_R |= SYSCTL_RCGC1_UART0;
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA;
- __delay(512);
+ lm3s_busyWait(512);
+
/* Set GPIO A0 and A1 as UART pins */
lm3s_gpio_pin_config(GPIO_PORTA_BASE, BV(0) | BV(1),
GPIO_DIR_MODE_HW, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
SYSCTL_RCGC1_R |= SYSCTL_RCGC1_SSI0;
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA;
SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOH;
- __delay(512);
+ lm3s_busyWait(512);
/* Configure the SSI0CLK and SSIOTX pins for SSI operation. */
lm3s_gpio_pin_config(GPIO_PORTA_BASE, BV(2) | BV(3) | BV(5),