build task

This commit is contained in:
2025-08-20 12:03:39 +02:00
parent 141a748d65
commit 29fda7b937
4 changed files with 39 additions and 3 deletions

6
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}

10
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"cmake.generator": "Unix Makefiles",
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.configureOnOpen": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"*.c": "c",
"*.h": "c"
}
}

21
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and Show Memory Info",
"type": "shell",
"command": "cmake --build build && avr-size --format=avr --mcu=attiny202 build/main.elf",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
}
]
}

5
main.c
View File

@ -4,11 +4,10 @@
int main(void) { int main(void) {
// Configure PA3 as output (Pin 7 on ATTINY202-SSN) // Configure PA3 as output (Pin 7 on ATTINY202-SSN)
VPORTA.DIR |= (1 << 3); VPORTA.DIR |= 8;
while (1) { while (1) {
VPORTA.OUT ^= (1 << 3); // toggle PA3 VPORTA.OUT ^= 8; // toggle PA3
_delay_ms(500); _delay_ms(500);
} }
} }