Skip to content

Commit 8ba71b1

Browse files
committed
Cleanup debugging
1 parent 70a630a commit 8ba71b1

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

examples/nordic/nrf5x/src/semihosting.zig

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,17 @@ const std = @import("std");
22
const microzig = @import("microzig");
33
const board = microzig.board;
44
const nrf = microzig.hal;
5-
const time = nrf.time;
65

76
const semihosting = microzig.core.experimental.ARM_semihosting;
8-
var TimeNow: isize = 0;
9-
10-
// DELETEME>>
11-
const uart = nrf.uart.num(0);
12-
13-
pub const microzig_options = microzig.Options{
14-
.log_level = .debug,
15-
.logFn = nrf.uart.log,
16-
};
17-
// DELETEME<<
187

198
pub fn main() void {
209
board.init();
21-
// DELETEME>>
22-
uart.apply(.{
23-
.tx_pin = board.uart_tx,
24-
.rx_pin = board.uart_rx,
25-
});
26-
27-
nrf.uart.init_logger(uart);
28-
// DELETEME<<
2910
const path = "";
3011
const file_name = path ++ "foo.txt";
3112
const new_name = path ++ "bar.txt";
3213
var some_buf: [80]u8 = undefined;
3314

34-
//debug features
15+
// Debug features
3516
semihosting.Debug.print("Hello World\n", .{});
3617

3718
const args = semihosting.Debug.get_cmd_args(&some_buf) catch return;
@@ -45,11 +26,11 @@ pub fn main() void {
4526
const stdout = semihosting.Debug.stdout() catch return;
4627
stdout.print("hello STDOUT!!!!\n", .{});
4728

48-
//time features
29+
// Time features
4930
const clock = semihosting.Time.absolute();
5031
const host_time = semihosting.Time.system_time();
5132

52-
//fs features
33+
// fs features
5334
const file = semihosting.fs.open(file_name, .@"W+") catch {
5435
semihosting.Debug.print("fail to open {s}!", .{file_name});
5536
return;

examples/stmicro/stm32/src/semihosting.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub fn main() void {
88
const new_name = path ++ "bar.txt";
99
var some_buf: [80]u8 = undefined;
1010

11-
//debug features
11+
// Debug features
1212
semihosting.Debug.print("Hello World\n", .{});
1313

1414
const args = semihosting.Debug.get_cmd_args(&some_buf) catch return;
@@ -22,11 +22,11 @@ pub fn main() void {
2222
const stdout = semihosting.Debug.stdout() catch return;
2323
stdout.print("hello STDOUT!!!!\n", .{});
2424

25-
//time features
25+
// Time features
2626
const clock = semihosting.Time.absolute();
2727
const host_time = semihosting.Time.system_time();
2828

29-
//fs features
29+
// fs features
3030
const file = semihosting.fs.open(file_name, .@"W+") catch {
3131
semihosting.Debug.print("fail to open {s}!", .{file_name});
3232
return;

0 commit comments

Comments
 (0)