Skip to content

Commit 8dc933b

Browse files
committed
Remove hello print
Screws with commands that return data, like the version info command. Signed-off-by: Daniel Schaefer <[email protected]>
1 parent a23ad9b commit 8dc933b

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

b1display/src/main.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ fn main() -> ! {
207207
screen_on: true,
208208
};
209209

210-
let mut said_hello = false;
211-
212210
let timer = Timer::new(pac.TIMER, &mut pac.RESETS);
213211
let mut prev_timer = timer.get_counter().ticks();
214212

@@ -223,22 +221,6 @@ fn main() -> ! {
223221
prev_timer = timer.get_counter().ticks();
224222
}
225223

226-
// A welcome message at the beginning
227-
if !said_hello && timer.get_counter().ticks() >= 2_000_000 {
228-
said_hello = true;
229-
let _ = serial.write(b"Hello, World!\r\n");
230-
231-
let time = timer.get_counter();
232-
let mut text: String<64> = String::new();
233-
write!(&mut text, "Current timer ticks: {}\r\n", time).unwrap();
234-
235-
// This only works reliably because the number of bytes written to
236-
// the serial port is smaller than the buffers available to the USB
237-
// peripheral. In general, the return value should be handled, so that
238-
// bytes not transferred yet don't get lost.
239-
let _ = serial.write(text.as_bytes());
240-
}
241-
242224
// Check for new data
243225
if usb_dev.poll(&mut [&mut serial]) {
244226
let mut buf = [0u8; 64];

c1minimal/src/main.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ fn main() -> ! {
125125
brightness: 10,
126126
};
127127

128-
let mut said_hello = false;
129-
130128
let timer = Timer::new(pac.TIMER, &mut pac.RESETS);
131129
let mut prev_timer = timer.get_counter().ticks();
132130

@@ -157,22 +155,6 @@ fn main() -> ! {
157155
prev_timer = timer.get_counter().ticks();
158156
}
159157

160-
// A welcome message at the beginning
161-
if !said_hello && timer.get_counter().ticks() >= 2_000_000 {
162-
said_hello = true;
163-
let _ = serial.write(b"Hello, World!\r\n");
164-
165-
let time = timer.get_counter();
166-
let mut text: String<64> = String::new();
167-
write!(&mut text, "Current timer ticks: {}\r\n", time).unwrap();
168-
169-
// This only works reliably because the number of bytes written to
170-
// the serial port is smaller than the buffers available to the USB
171-
// peripheral. In general, the return value should be handled, so that
172-
// bytes not transferred yet don't get lost.
173-
let _ = serial.write(text.as_bytes());
174-
}
175-
176158
// Check for new data
177159
if usb_dev.poll(&mut [&mut serial]) {
178160
let mut buf = [0u8; 64];

ledmatrix/src/main.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ fn main() -> ! {
207207
.set_scaling(state.brightness)
208208
.expect("failed to set scaling");
209209

210-
let mut said_hello = false;
211-
212210
fill_grid_pixels(&state.grid, &mut matrix);
213211

214212
let timer = Timer::new(pac.TIMER, &mut pac.RESETS);
@@ -243,22 +241,6 @@ fn main() -> ! {
243241
prev_timer = timer.get_counter().ticks();
244242
}
245243

246-
// A welcome message at the beginning
247-
if !said_hello && timer.get_counter().ticks() >= 2_000_000 {
248-
said_hello = true;
249-
let _ = serial.write(b"Hello, World!\r\n");
250-
251-
let time = timer.get_counter();
252-
let mut text: String<64> = String::new();
253-
write!(&mut text, "Current timer ticks: {}\r\n", time).unwrap();
254-
255-
// This only works reliably because the number of bytes written to
256-
// the serial port is smaller than the buffers available to the USB
257-
// peripheral. In general, the return value should be handled, so that
258-
// bytes not transferred yet don't get lost.
259-
let _ = serial.write(text.as_bytes());
260-
}
261-
262244
// Check for new data
263245
if usb_dev.poll(&mut [&mut serial]) {
264246
let mut buf = [0u8; 64];

0 commit comments

Comments
 (0)