代码:
void main(void) { NVIC_InitTypeDef NVIC_InitStructure;
AFIO->MAPR = 0x04000002; DBGMCU->CR = 0x40;
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE); GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE); while (1) { st_delay_ms(1000); // about 0.9second
GPIOB->ODR = 0x50; // B6 OK ONE!! st_delay_ms(1000);
GPIOB->ODR = 0x08; // B6 OK ZERO
}
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOB, &GPIO_InitStructure);
|