Skip to content
Snippets Groups Projects
Unverified Commit e28a05b1 authored by CNLohr's avatar CNLohr Committed by GitHub
Browse files

Merge pull request #218 from fr0sty1/blink

Blink LED pin D6 as well (for MuseLabs nanoCH32V003 boards)
parents b7f1e337 287c96e0
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -16,16 +16,20 @@ int main() ...@@ -16,16 +16,20 @@ int main()
GPIOD->CFGLR &= ~(0xf<<(4*4)); GPIOD->CFGLR &= ~(0xf<<(4*4));
GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*4); GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*4);
// GPIO D6 Push-Pull
GPIOD->CFGLR &= ~(0xf<<(4*6));
GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*6);
// GPIO C0 Push-Pull // GPIO C0 Push-Pull
GPIOC->CFGLR &= ~(0xf<<(4*0)); GPIOC->CFGLR &= ~(0xf<<(4*0));
GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0); GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0);
while(1) while(1)
{ {
GPIOD->BSHR = 1 | (1<<4); // Turn on GPIOs GPIOD->BSHR = (1<<0) | (1<<4) | (1<<6); // Turn on GPIOs
GPIOC->BSHR = 1; GPIOC->BSHR = (1<<0);
Delay_Ms( 250 ); Delay_Ms( 250 );
GPIOD->BSHR = (1<<16) | (1<<(16+4)); // Turn off GPIODs GPIOD->BSHR = (1<<16) | (1<<(16+4)) | (1<<(16+6)); // Turn off GPIOs
GPIOC->BSHR = (1<<16); GPIOC->BSHR = (1<<16);
Delay_Ms( 250 ); Delay_Ms( 250 );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment