//! The floor: the smallest thing that can boot on this chip and prove it is alive. //! No printing, no descriptor text - just a pin that toggles. Build it with //! zig build -Dapp=examples/minimal.zig size const std = @import("std"); const config = @import("config"); const soc = @import("soc"); /// Even the floor needs a panic handler: the default one formats and would pull in half of std. pub const panic = std.debug.FullPanic(struct { fn call(_: []const u8, _: ?usize) noreturn { while (true) {} } }.call); const led: u6 = @intCast(config.led_pin); export fn zig_main() noreturn { soc.gpio.configureOutput(led, .{}); while (true) { soc.gpio.setHigh(led); soc.rom.ets_delay_us(100_000); soc.gpio.setLow(led); soc.rom.ets_delay_us(100_000); } } export fn _start() linksection(".text.entry") callconv(.naked) noreturn { asm volatile ( \\ li t0, 1 << 13 \\ csrs mstatus, t0 \\ la sp, __stack_top \\ la t0, __bss_start \\ la t1, __bss_end \\ bgeu t0, t1, 2f \\1: \\ sw zero, 0(t0) \\ addi t0, t0, 4 \\ bltu t0, t1, 1b \\2: \\ j zig_main ); }