adding a test that blinks all the GPIO --- good for testing soldering

jobs.
This commit is contained in:
Mariano Alvira 2009-09-07 14:39:48 -04:00
parent e6d42dc4b2
commit 16f680544c

36
tests/blink-allio.c Normal file
View File

@ -0,0 +1,36 @@
#define MBAR_GPIO 0x80000000
#define GPIO_PAD_DIR0 0x80000000
#define GPIO_DATA0 0x80000008
#define GPIO_PAD_DIR1 0x80000004
#define GPIO_DATA1 0x8000000c
#define UART1_DATA 0x80005008
#define DELAY 400000
#include "embedded_types.h"
#include "isr.h"
#include "led.h"
#define LED_BITS LED_WHITE
__attribute__ ((section ("startup")))
void main(void) {
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0xffffffff;
*(volatile uint32_t *)GPIO_PAD_DIR1 = 0xffffffff;
volatile uint32_t i;
while(1) {
*(volatile uint32_t *)GPIO_DATA0 = 0xffffffff;
*(volatile uint32_t *)GPIO_DATA1 = 0xffffffff;
for(i=0; i<DELAY; i++) { continue; }
*(volatile uint32_t *)GPIO_DATA0 = 0x00000000;
*(volatile uint32_t *)GPIO_DATA1 = 0x00000000;
for(i=0; i<DELAY; i++) { continue; }
};
}