Skip to content
Snippets Groups Projects
Commit 32da93a2 authored by cnlohr's avatar cnlohr
Browse files

Update blink, starting to work with vs code.

parent 6a1fbb35
No related branches found
No related tags found
No related merge requests found
{
"configurations": [
{
"name": "GDB debug - custom",
"type": "cppdbg",
"request": "launch",
"program": "blink.elf",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb-multiarch",
"miDebuggerServerAddress": "127.0.0.1:2000"
}
]
}
{
"cmake.configureOnOpen": false,
"makefile.launchConfigurations": [
{
"cwd": "/home/cnlohr/git/ch32v003fun/examples/blink",
"sbinaryPath": "/home/cnlohr/git/ch32v003fun/examples/blink/blink.elf",
"binaryArgs": []
}
],
"editor.insertSpaces": false,
"editor.tabSize": 4
}
No preview for this file type
......@@ -6,7 +6,8 @@
#define APB_CLOCK SYSTEM_CORE_CLOCK
uint32_t count;
volatile uint32_t count;
int main()
{
SystemInit48HSI();
......@@ -26,8 +27,6 @@ int main()
GPIOC->CFGLR &= ~(0xf<<(4*0));
GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0);
count = &count;
while(1)
{
GPIOD->BSHR = 1 | (1<<4); // Turn on GPIOs
......@@ -35,8 +34,9 @@ int main()
Delay_Ms( 250 );
GPIOD->BSHR = (1<<16) | (1<<(16+4)); // Turn off GPIODs
GPIOC->BSHR = (1<<16);
Delay_Ms( 250 );
Delay_Ms( count );
count++;
if( count > 250 ) count = 0;
}
}
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