diff --git a/va416xx-hal/.vscode/launch.json b/va416xx-hal/.vscode/launch.json deleted file mode 100644 index 6f90c38..0000000 --- a/va416xx-hal/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "cortex-debug", - "request": "launch", - "name": "Debug LED Blinky", - // The user should start the J-Link server themselves for now. This is because the - // Cortex-Debug will issue a reset command, which is problematic even with - // a valid JLinkScript file - "servertype": "external", - "gdbTarget": "localhost:2331", - "gdbPath": "/usr/bin/gdb-multiarch", - "cwd": "${workspaceRoot}", - "device": "Cortex-M4", - "svdFile": "../va416xx/svd/va416xx-base.svd", - "preLaunchTask": "rust: cargo build led blinky", - "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/blinky", - "interface": "swd", - "runToMain": true, - }, - ] -} \ No newline at end of file diff --git a/va416xx-hal/.vscode/tasks.json b/va416xx-hal/.vscode/tasks.json deleted file mode 100644 index b17869b..0000000 --- a/va416xx-hal/.vscode/tasks.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "rust: cargo build led blinky", - "type": "shell", - "command": "~/.cargo/bin/cargo", // note: full path to the cargo - "args": [ - "build", "--example", "blinky" - ], - "group": { - "kind": "build", - "isDefault": true - } - }, - ] -} \ No newline at end of file diff --git a/va416xx-hal/examples/blinky.rs b/va416xx-hal/examples/blinky.rs index 59da3f1..be5633d 100644 --- a/va416xx-hal/examples/blinky.rs +++ b/va416xx-hal/examples/blinky.rs @@ -3,7 +3,7 @@ #![no_std] use cortex_m_rt::entry; -use embedded_hal::digital::StatefulOutputPin; +use embedded_hal::digital::{OutputPin, StatefulOutputPin}; use panic_halt as _; use va416xx_hal::{gpio::PinsG, pac}; @@ -19,7 +19,9 @@ fn main() -> ! { let mut led = portg.pg5.into_readable_push_pull_output(); //let mut delay = CountDownTimer::new(&mut dp.SYSCONFIG, 50.mhz(), dp.TIM0); loop { - led.toggle().ok(); + led.set_high().ok(); + cortex_m::asm::delay(2_000_000); + led.set_low().ok(); cortex_m::asm::delay(2_000_000); } } diff --git a/vscode/launch.json b/vscode/launch.json index d6d10d1..88040ee 100644 --- a/vscode/launch.json +++ b/vscode/launch.json @@ -15,11 +15,11 @@ "gdbTarget": "localhost:2331", "cwd": "${workspaceRoot}", "device": "Cortex-M4", - "svdFile": "${workspaceFolder}/va416xx/svd/va416xx-base.svd", - "preLaunchTask": "rust: cargo build led blinky pac", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "blinky-pac-example", "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/blinky-pac", "interface": "swd", - "runToMain": true, + "runToEntryPoint": "main", }, { "type": "cortex-debug", @@ -29,11 +29,11 @@ "gdbTarget": "localhost:2331", "cwd": "${workspaceRoot}", "device": "Cortex-M4", - "svdFile": "${workspaceFolder}/va416xx/svd/va416xx-base.svd", - "preLaunchTask": "rust: cargo build led blinky", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "blinky-example", "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/blinky", "interface": "swd", - "runToMain": true, + "runToEntryPoint": "main", }, { "type": "cortex-debug", @@ -43,11 +43,11 @@ "gdbTarget": "localhost:2331", "cwd": "${workspaceRoot}", "device": "Cortex-M4", - "svdFile": "${workspaceFolder}/va416xx/svd/va416xx-base.svd", - "preLaunchTask": "rust: cargo build rtt", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "rtt-log-example", "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/rtt-log", "interface": "swd", - "runToMain": true, + "runToEntryPoint": "main", }, ] -} +} \ No newline at end of file diff --git a/vscode/tasks.json b/vscode/tasks.json index 2a52e98..d7113a3 100644 --- a/vscode/tasks.json +++ b/vscode/tasks.json @@ -4,11 +4,15 @@ "version": "2.0.0", "tasks": [ { - "label": "rust: cargo build led blinky pac", + "label": "blinky-pac-example", "type": "shell", "command": "~/.cargo/bin/cargo", // note: full path to the cargo "args": [ - "build", "-p", "va416xx-hal", "--example", "blinky-pac" + "build", + "-p", + "va416xx-hal", + "--example", + "blinky-pac" ], "group": { "kind": "build", @@ -16,11 +20,15 @@ } }, { - "label": "rust: cargo build rtt", + "label": "rtt-log-example", "type": "shell", "command": "~/.cargo/bin/cargo", // note: full path to the cargo "args": [ - "build", "-p", "va416xx-hal", "--example", "rtt-log" + "build", + "-p", + "va416xx-hal", + "--example", + "rtt-log" ], "group": { "kind": "build", @@ -28,11 +36,15 @@ } }, { - "label": "rust: cargo build led blinky", + "label": "blinky-example", "type": "shell", "command": "~/.cargo/bin/cargo", // note: full path to the cargo "args": [ - "build", "-p", "vorago-hal", "--example", "blinky" + "build", + "-p", + "va416xx-hal", + "--example", + "blinky" ], "group": { "kind": "build", @@ -40,4 +52,4 @@ } }, ] -} +} \ No newline at end of file