##// END OF EJS Templates
Added Oplayer BSP, Fixed bug on GPIO library(gpiosetval change all the port...
Added Oplayer BSP, Fixed bug on GPIO library(gpiosetval change all the port instead of the desired bit).

File last commit:

r18:bd9ab647f70a default
r60:17402611bd25 dev_alexis
Show More
main.c
59 lines | 1.3 KiB | text/x-c | CLexer
#include <bsp.h>
#include <gpio.h>
#include <uart.h>
#include <stm32f4xx_rcc.h>
#include <stm32f4xx_gpio.h>
#include <streamdevices.h>
#include <libucstrings.h>
#include <stdio.h>
#define delay for(volatile int i=0;i<1024*256;i++)
//streamdevice* stdo;
int main()
{
gpio_t gpio1,gpio2,gpio3;
gpio1 = gpioopen(PD13);
gpio2 = gpioopen(PD14);
gpio3 = gpioopen(PD15);
gpiosetdir(&gpio1,gpiooutdir);
gpiosetdir(&gpio2,gpiooutdir);
gpiosetdir(&gpio3,gpiooutdir);
//libucprintf("test\n\r");
int i=0;
printf("hello world\n\r");
printf("hello world\n\r");
printf("Value Float=%f\n\r",0.23);
uart_t* uart1 = malloc(sizeof(uart_t));
free(uart1);
FILE *test=fopen("UART3","w+");
uartopenandconfig(2,uart1,uartparitynone | uart8bits | uartonestop,115200,PD8,PD9,-1,-1);
fprintf(test,"Value Float=%f\n\r",0.23);
while(1)
{
gpioset(gpio1);
delay;
gpioset(gpio2);
delay;
gpioset(gpio3);
delay;
gpioclr(gpio1);
delay;
gpioclr(gpio2);
delay;
gpioclr(gpio3);
delay;
//uartputc(&uart1,0x5A);
//spiputw(&spi1,0x0F);
//libucfprintf(&fd1,"i= %d 0x%x\n\r",i,i);
i++;
//uartputc(&Xbee,i++);
}
return 0;
}