buffer initialization
Hi, I can't seem to make the piece of code below running. The user LED on the EVLM3S811 never lights on! What am I doing wrong ? The problem is located in the for loop which seems to work if I decrease the buffer's size to say 200.
thanks in advance for your help
PS: memset(buf, 'A', sizeof(buf)) doesn't work either.
#include "hw_types.h" #include "hw_memmap.h" #include "sysctl.h" #include "gpio.h"
int main(void) { int buf[512]; int i;
// Set the clocking to run at 20MHz from the PLL SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ);
// Enable the peripherals used by the application SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); // Configure LED, push button GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_DIR_MODE_OUT); GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, 0);
for(i=0; i<310; i++) buf[i] = 0x0; i = buf[0]; // to avoid warning in this example GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_PIN_5);
while(1);
}
Post edited by: fv78, at: 2007/02/01 01:22
login or register to reply
|