copied over blink program from IDE developed program I wrote.

This commit is contained in:
jakeg00dwin 2024-12-06 21:16:20 -08:00
parent c8f3320dab
commit 0be7187865
1 changed files with 41 additions and 5 deletions

View File

@ -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"); GPIO_InitTypeDef GPIO_InitStructure = {0};
return 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));
}
}