Merge branch 'master' into rp2040-testing
This commit is contained in:
commit
675439c63a
31
src/main.zig
31
src/main.zig
|
@ -4,39 +4,14 @@ const algo = @import("algorithm.zig");
|
|||
const robot = algo.robot;
|
||||
const map = @import("map.zig");
|
||||
|
||||
const rp2040 = @import("microzig").hal;
|
||||
// const multicore = rp2040.multicore;
|
||||
|
||||
// TODO: move into algo
|
||||
pub fn alt_core () noreturn {
|
||||
// while true
|
||||
// Flash pin 6 for now
|
||||
while (true) {
|
||||
if (is_robot) {
|
||||
robot.toggle_led_6();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const is_robot = algo.is_robot;
|
||||
|
||||
const time = @import("microzig").hal.time;
|
||||
|
||||
// Entry point for second core
|
||||
fn core1 () noreturn {
|
||||
time.sleep_ms(1000);
|
||||
alt_core();
|
||||
}
|
||||
|
||||
pub fn main() !noreturn {
|
||||
// Power On test
|
||||
|
||||
// Setup
|
||||
algo.setup();
|
||||
|
||||
// // Flood fill to the goal
|
||||
// Flood fill to the goal
|
||||
algo.floodFill(map.goals[0..]);
|
||||
|
||||
// // Flood fill back to the start
|
||||
// Flood fill back to the start
|
||||
const starts = [_]map.Point{ map.start };
|
||||
algo.floodFill(starts[0..]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue