# HG changeset patch # User jeandet@pc-de-jeandet3.LAB-LPP.LOCAL # Date 2012-11-30 16:08:19 # Node ID ee74c90426e95a760fdb7d9ffeb0a825e5ff0bb0 # Parent 27c5438a4566c49fa3e1c3d2b02fc6c01688b123 Sync diff --git a/bsp/src/M4Stick/bsp.c b/bsp/src/M4Stick/bsp.c --- a/bsp/src/M4Stick/bsp.c +++ b/bsp/src/M4Stick/bsp.c @@ -52,18 +52,12 @@ int bsp_init() void bsp_GPIO_init() { - gpio_t gpio1 = gpioopen(PD12);//gpioopen(LED1); //PD9 D=> 0x0300 9 => 0x0009 - gpio_t gpio2 = gpioopen(PD13);//gpioopen(LED2); - gpio_t gpio3 = gpioopen(PD14);//gpioopen(LED2); - gpio_t gpio4 = gpioopen(PD15);//gpioopen(LED2); + gpio_t gpio1 = gpioopen(PC6);//gpioopen(LED1); //PD9 D=> 0x0300 9 => 0x0009 + gpio_t gpio2 = gpioopen(PC7);//gpioopen(LED2); gpiosetspeed(&gpio1,gpiohighspeed); gpiosetspeed(&gpio2,gpiohighspeed); - gpiosetspeed(&gpio3,gpiohighspeed); - gpiosetspeed(&gpio4,gpiohighspeed); gpiosetdir(&gpio1,gpiooutdir); - gpiosetdir(&gpio3,gpiooutdir); gpiosetdir(&gpio2,gpiooutdir); - gpiosetdir(&gpio4,gpiooutdir); } void bsp_uart_init() @@ -72,13 +66,13 @@ void bsp_uart_init() { //uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); - uart_t uart = uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,PB10,PB11,-1,-1); + uart_t uart = uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,LED2,LED1,-1,-1); uartmkstreamdev(uart,fd1); __opnfiles__[1] = fd1; } else { - uartopenandconfig(2,uartparitynone | uart8bits | uartonestop,115200,PB10,PB11,-1,-1); + uartopenandconfig(uart3,uartparitynone | uart8bits | uartonestop,115200,LED2,LED1,-1,-1); } } diff --git a/examples/BeagleSynthHello/main.c b/examples/BeagleSynthHello/main.c --- a/examples/BeagleSynthHello/main.c +++ b/examples/BeagleSynthHello/main.c @@ -73,7 +73,7 @@ int main() printf("Sys Tick=%d\n\r",SysTick->VAL); printf("Sys Tick=%d\n\r",SysTick->VAL); ili9328paintFilRect(&lcd0,1,1,3,3,LCD_COLOR_BLACK,1,LCD_COLOR_WHITE); - while(1)randBoxesDemo(); + while(1)monkDemo(); //randBoxesDemo(); if(-1==ina226open(&ina33VSens,i2c2,INA226_MODE_SHUNT_VOLTAGE_CONTINUOUS|INA226_AVERAGES_16|INA226_BUS_CONV_8244us|INA226_SHUNT_CONV_8244us,0,1,15,1000000)) { printf("Can't open 3.3V monitor\n\r"); diff --git a/examples/SOLAR_PSU_HELLO/hello.pro b/examples/SOLAR_PSU_HELLO/hello.pro --- a/examples/SOLAR_PSU_HELLO/hello.pro +++ b/examples/SOLAR_PSU_HELLO/hello.pro @@ -3,7 +3,8 @@ CONFIG += console CONFIG -= qt #BSP = BEAGLESYNTH -BSP = SOLAR_LFR_PSU +#BSP = SOLAR_LFR_PSU +BSP=M4Stick include($$(libuc2)/bsp/cfg/$$BSP/bsp.pri) #include($$(libuc2)/rules/stm32f4-arm-none-eabi-gcc/rules.pri) diff --git a/examples/SOLAR_PSU_HELLO/main.c b/examples/SOLAR_PSU_HELLO/main.c --- a/examples/SOLAR_PSU_HELLO/main.c +++ b/examples/SOLAR_PSU_HELLO/main.c @@ -4,21 +4,19 @@ #include #include #include - +#include extern streamdevice* __opnfiles__[]; int main() { - //gpioset(PSU_DISABLE); - while(1) + while(1) { - for(volatile int i=0;i<1024*2048;i++); gpioset(LED1); gpioclr(LED2); - for(volatile int i=0;i<1024*2048;i++); gpioclr(LED1); gpioset(LED2); + printf("Hello\n\r"); } printf("hello world\n\r"); return 0; diff --git a/lib/src/stm32f4/CPU/stm32f4xxxG/cpuinit.c b/lib/src/stm32f4/CPU/stm32f4xxxG/cpuinit.c --- a/lib/src/stm32f4/CPU/stm32f4xxxG/cpuinit.c +++ b/lib/src/stm32f4/CPU/stm32f4xxxG/cpuinit.c @@ -12,7 +12,7 @@ extern int main(); void cpu_init() { extern uint32_t currentCpuFreq; - currentCpuFreq = 180*1000*1000; + currentCpuFreq = 16*1000*1000; enable_FPU(); RCC->CR |= (uint32_t)0x00000001; FLASH->ACR = FLASH_ACR_ICEN |FLASH_ACR_DCEN |FLASH_ACR_LATENCY_5WS;