copied over blink program from IDE developed program I wrote.
This commit is contained in:
parent
c8f3320dab
commit
0be7187865
46
src/main.c
46
src/main.c
|
@ -1,8 +1,44 @@
|
|||
#include "stdio.h"
|
||||
#include "debug.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
/* Global typedef */
|
||||
|
||||
/* Global define */
|
||||
|
||||
/* Global Variable */
|
||||
|
||||
void GPIO_Toggle_INIT(void)
|
||||
{
|
||||
printf("Hello!\n");
|
||||
return 0;
|
||||
GPIO_InitTypeDef GPIO_InitStructure = {0};
|
||||
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn main
|
||||
* @brief Main program
|
||||
* @return none
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
u8 i = 0;
|
||||
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
|
||||
SystemCoreClockUpdate();
|
||||
Delay_Init();
|
||||
//USART_Printf_Init(115200);
|
||||
//printf("SystemClk:%d\r\n", SystemCoreClock);
|
||||
//printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
|
||||
//printf("GPIO Toggle TEST\r\n");
|
||||
GPIO_Toggle_INIT();
|
||||
|
||||
while(1)
|
||||
{
|
||||
Delay_Ms(250);
|
||||
GPIO_WriteBit(GPIOA, GPIO_Pin_1, (i == 0) ? (i = Bit_SET) : (i = Bit_RESET));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue