Skip to content

Commit a366c2c

Browse files
authored
Merge pull request #101 from Neotron-Compute/update-video-api
Update Video API
2 parents 182761c + 1d8cd0e commit a366c2c

17 files changed

+756
-529
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This will make a UF2 and copy it to the RP2040's Mass Storage Device bootloader
33
# runner = "elf2uf2-rs -d"
44
# This will flash over SWD with any compatible probe it finds.
5-
runner = "probe-rs run --chip RP2040"
5+
runner = "probe-rs run --chip RP2040 --speed 10000"
66
rustflags = [
77
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
88
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
submodules: true
1616
fetch-depth: 0

.github/workflows/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout Code
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
submodules: true
1616
fetch-depth: 0

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout Code
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111
with:
1212
submodules: true
1313
fetch-depth: 0

.vscode/README.md

Lines changed: 0 additions & 109 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "probe-rs-debug",
66
"request": "launch",
77
"name": "Run with probe-rs",
8-
"speed": 20000,
8+
"speed": 10000,
99
"preLaunchTask": "Cargo Build (release)",
1010
"flashingConfig": {
1111
"flashingEnabled": true,

Cargo.lock

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rp2040-hal = { version = "0.9", features = [ "defmt" ] }
2121
# Cortex-M run-time (or start-up) code
2222
cortex-m-rt = "0.7"
2323
# The BIOS to OS API
24-
neotron-common-bios = "0.11.1"
24+
neotron-common-bios = "0.12.0"
2525
# For the RP2040 bootloader
2626
rp2040-boot2 = "0.3.0"
2727
# For hardware abstraction traits
@@ -64,7 +64,7 @@ embedded-sdmmc = { version = "0.6", default-features = false, features = [
6464
tlv320aic23 = "0.1.0"
6565

6666
[build-dependencies]
67-
neotron-common-bios = "0.11.1"
67+
neotron-common-bios = "0.12.0"
6868
vte = "0.11"
6969

7070
[[bin]]
@@ -89,6 +89,4 @@ check-stack = []
8989

9090
[patch.crates-io]
9191
# Patched to include the WriteIterRead trait on i2c
92-
rp2040-hal = { git = "https://github.com/rp-rs/rp-hal", rev = "9c17a2d" }
93-
# Patched to include the WriteIterRead trait on i2c
9492
shared-bus = { git = "https://github.com/thejpster/shared-bus", rev = "639a2e6" }

build.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ struct NeotronOutput {
7979

8080
impl NeotronOutput {
8181
const DEFAULT_ATTR: Attr = Attr::new(
82-
TextForegroundColour::LIGHT_GRAY,
83-
TextBackgroundColour::BLACK,
82+
TextForegroundColour::LightGray,
83+
TextBackgroundColour::Black,
8484
false,
8585
);
8686

@@ -124,54 +124,54 @@ impl vte::Perform for NeotronOutput {
124124
}
125125
// Background
126126
40 => {
127-
self.attr.set_bg(TextBackgroundColour::BLACK);
127+
self.attr.set_bg(TextBackgroundColour::Black);
128128
}
129129
41 => {
130-
self.attr.set_bg(TextBackgroundColour::RED);
130+
self.attr.set_bg(TextBackgroundColour::Red);
131131
}
132132
42 => {
133-
self.attr.set_bg(TextBackgroundColour::GREEN);
133+
self.attr.set_bg(TextBackgroundColour::Green);
134134
}
135135
43 => {
136-
self.attr.set_bg(TextBackgroundColour::BROWN);
136+
self.attr.set_bg(TextBackgroundColour::Brown);
137137
}
138138
44 => {
139-
self.attr.set_bg(TextBackgroundColour::BLUE);
139+
self.attr.set_bg(TextBackgroundColour::Blue);
140140
}
141141
45 => {
142-
self.attr.set_bg(TextBackgroundColour::MAGENTA);
142+
self.attr.set_bg(TextBackgroundColour::Magenta);
143143
}
144144
46 => {
145-
self.attr.set_bg(TextBackgroundColour::CYAN);
145+
self.attr.set_bg(TextBackgroundColour::Cyan);
146146
}
147147
47 | 49 => {
148148
// Default
149-
self.attr.set_bg(TextBackgroundColour::BLACK);
149+
self.attr.set_bg(TextBackgroundColour::Black);
150150
}
151151
// Foreground
152152
30 => {
153-
self.attr.set_fg(TextForegroundColour::BLACK);
153+
self.attr.set_fg(TextForegroundColour::Black);
154154
}
155155
31 => {
156-
self.attr.set_fg(TextForegroundColour::RED);
156+
self.attr.set_fg(TextForegroundColour::Red);
157157
}
158158
32 => {
159-
self.attr.set_fg(TextForegroundColour::GREEN);
159+
self.attr.set_fg(TextForegroundColour::Green);
160160
}
161161
33 => {
162-
self.attr.set_fg(TextForegroundColour::YELLOW);
162+
self.attr.set_fg(TextForegroundColour::Yellow);
163163
}
164164
34 => {
165-
self.attr.set_fg(TextForegroundColour::BLUE);
165+
self.attr.set_fg(TextForegroundColour::Blue);
166166
}
167167
35 => {
168-
self.attr.set_fg(TextForegroundColour::MAGENTA);
168+
self.attr.set_fg(TextForegroundColour::Magenta);
169169
}
170170
36 => {
171-
self.attr.set_fg(TextForegroundColour::CYAN);
171+
self.attr.set_fg(TextForegroundColour::Cyan);
172172
}
173173
37 | 39 => {
174-
self.attr.set_fg(TextForegroundColour::LIGHT_GRAY);
174+
self.attr.set_fg(TextForegroundColour::LightGray);
175175
}
176176
0 => {
177177
self.attr = Self::DEFAULT_ATTR;
@@ -184,29 +184,29 @@ impl vte::Perform for NeotronOutput {
184184
}
185185
if self.bright {
186186
match self.attr.fg() {
187-
TextForegroundColour::BLACK => {
188-
self.attr.set_fg(TextForegroundColour::DARK_GRAY);
187+
TextForegroundColour::Black => {
188+
self.attr.set_fg(TextForegroundColour::DarkGray);
189189
}
190-
TextForegroundColour::RED => {
191-
self.attr.set_fg(TextForegroundColour::LIGHT_RED);
190+
TextForegroundColour::Red => {
191+
self.attr.set_fg(TextForegroundColour::LightRed);
192192
}
193-
TextForegroundColour::GREEN => {
194-
self.attr.set_fg(TextForegroundColour::LIGHT_GREEN);
193+
TextForegroundColour::Green => {
194+
self.attr.set_fg(TextForegroundColour::LightGreen);
195195
}
196-
TextForegroundColour::BROWN => {
197-
self.attr.set_fg(TextForegroundColour::YELLOW);
196+
TextForegroundColour::Brown => {
197+
self.attr.set_fg(TextForegroundColour::Yellow);
198198
}
199-
TextForegroundColour::BLUE => {
200-
self.attr.set_fg(TextForegroundColour::LIGHT_BLUE);
199+
TextForegroundColour::Blue => {
200+
self.attr.set_fg(TextForegroundColour::LightBlue);
201201
}
202-
TextForegroundColour::MAGENTA => {
203-
self.attr.set_fg(TextForegroundColour::PINK);
202+
TextForegroundColour::Magenta => {
203+
self.attr.set_fg(TextForegroundColour::Magenta);
204204
}
205-
TextForegroundColour::CYAN => {
206-
self.attr.set_fg(TextForegroundColour::LIGHT_CYAN);
205+
TextForegroundColour::Cyan => {
206+
self.attr.set_fg(TextForegroundColour::LightCyan);
207207
}
208-
TextForegroundColour::LIGHT_GRAY => {
209-
self.attr.set_fg(TextForegroundColour::WHITE);
208+
TextForegroundColour::LightGray => {
209+
self.attr.set_fg(TextForegroundColour::White);
210210
}
211211
_ => {
212212
// Do nothing

0 commit comments

Comments
 (0)