Skip to content

Commit c0b5f25

Browse files
authored
Fixup build.zig.zon for 0.14.0 / zig-master branch (#400)
1 parent 4e4dbf3 commit c0b5f25

File tree

33 files changed

+82
-57
lines changed

33 files changed

+82
-57
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
## What version of Zig to use
1010

11-
Zig 0.13.0
11+
Zig 0.14.0
1212

1313
## Getting Started With MicroZig
1414

build-internals/build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.{
2-
.name = "build-internals",
2+
.name = .build_internals,
33
.version = "0.0.0",
44
.dependencies = .{
55
.regz = .{ .path = "../tools/regz" },

build.zig.zon

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.{
2-
.name = "microzig",
2+
.name = .microzig,
3+
// Note: This should be changed if you fork microzig!
4+
.fingerprint = 0x605a83a849186d0f,
35
.version = "0.13.2",
46
.minimum_zig_version = "0.13.0",
57
.dependencies = .{
@@ -27,8 +29,8 @@
2729

2830
// used for creating package tarballs
2931
.boxzer = .{
30-
.url = "git+https://github.com/mattnite/boxzer.git#59da7d6bcbecb8cb7e76236ea9d18a7a6bcb4d00",
31-
.hash = "1220457e3991f346f2eb4c7adfc1fcd60d71b10a127468949dd91e924e1ec44956f1",
32+
.url = "git+https://github.com/mattnite/boxzer.git#ba48dc0beed520d3fd91738e3717776ac02df175",
33+
.hash = "boxzer-0.1.0-UECMFB7WAAAOQio_OOb84Tmeft26gQ6Ec6jL5MUU_h1r",
3234
},
3335
},
3436
.paths = .{

core/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "core",
2+
.name = .core,
3+
.fingerprint = 0x6b8d854f5061dc46,
34
.version = "0.0.1",
45
.paths = .{
56
"LICENSE",

drivers/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "microzig_driver_framework",
2+
.name = .driverframework,
3+
.fingerprint = 0xfec1b5453a206a46,
34
.version = "0.0.1",
45
.paths = .{
56
"LICENSE",

drivers/stepper/stepper.zig

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ pub fn Stepper(comptime Driver: type) type {
7676
steps_remaining: u32 = 0,
7777
// Steps remaining in decel
7878
steps_to_brake: u32 = 0,
79-
// TODO: Just `.from_us(0)` with zig 0.14!
80-
step_pulse: mdf.time.Duration = mdf.time.Duration.from_us(0),
81-
cruise_step_pulse: mdf.time.Duration = mdf.time.Duration.from_us(0),
82-
remainder: mdf.time.Duration = mdf.time.Duration.from_us(0),
83-
last_action_end: mdf.time.Absolute = mdf.time.Absolute.from_us(0),
84-
next_action_interval: mdf.time.Duration = mdf.time.Duration.from_us(0),
79+
step_pulse: mdf.time.Duration = .from_us(0),
80+
cruise_step_pulse: mdf.time.Duration = .from_us(0),
81+
remainder: mdf.time.Duration = .from_us(0),
82+
last_action_end: mdf.time.Absolute = .from_us(0),
83+
next_action_interval: mdf.time.Duration = .from_us(0),
8584
step_count: u32 = 0,
8685
dir_state: mdf.base.Digital_IO.State = .low,
8786
motor_steps: u16,
@@ -191,16 +190,16 @@ pub fn Stepper(comptime Driver: type) type {
191190
}
192191

193192
pub fn start_move(self: *Self, steps: i32) void {
194-
self.start_move_time(steps, mdf.time.Duration.from_us(0));
193+
self.start_move_time(steps, .from_us(0));
195194
}
196195

197196
pub fn start_move_time(self: *Self, steps: i32, time: mdf.time.Duration) void {
198197
// set up new move
199198
self.dir_state = if (steps >= 0) .high else .low;
200-
self.last_action_end = mdf.time.Absolute.from_us(0);
199+
self.last_action_end = .from_us(0);
201200
self.steps_remaining = @abs(steps);
202201
self.step_count = 0;
203-
self.remainder = mdf.time.Duration.from_us(0);
202+
self.remainder = .from_us(0);
204203
switch (self.profile) {
205204
.linear_speed => |p| {
206205
const microstep_f: f64 = @floatFromInt(self.microsteps);
@@ -237,7 +236,7 @@ pub fn Stepper(comptime Driver: type) type {
237236
self.cruise_step_pulse = get_step_pulse(self.motor_steps, self.microsteps, self.rpm);
238237
self.step_pulse = self.cruise_step_pulse;
239238
if (@intFromEnum(time) > self.steps_remaining * @intFromEnum(self.step_pulse)) {
240-
self.step_pulse = mdf.time.Duration.from_us(@intFromFloat(@as(f64, @floatFromInt(time.to_us())) /
239+
self.step_pulse = .from_us(@intFromFloat(@as(f64, @floatFromInt(time.to_us())) /
241240
@as(f64, @floatFromInt(self.steps_remaining))));
242241
}
243242
},
@@ -272,7 +271,7 @@ pub fn Stepper(comptime Driver: type) type {
272271
} else {
273272
// The series approximates target, set the final value to what it should be instead
274273
self.step_pulse = self.cruise_step_pulse;
275-
self.remainder = mdf.time.Duration.from_us(0);
274+
self.remainder = .from_us(0);
276275
}
277276
},
278277
.decelerating => {
@@ -297,7 +296,7 @@ pub fn Stepper(comptime Driver: type) type {
297296
self.clock.sleep_us(@intFromEnum(delay_us));
298297
return;
299298
}
300-
const deadline = mdf.time.Deadline.init_relative(start_us, delay_us);
299+
const deadline: mdf.time.Deadline = .init_relative(start_us, delay_us);
301300
while (!deadline.is_reached_by(self.clock.get_time_since_boot())) {}
302301
}
303302

@@ -320,8 +319,8 @@ pub fn Stepper(comptime Driver: type) type {
320319
self.next_action_interval = if (elapsed.less_than(pulse)) pulse.minus(elapsed) else @enumFromInt(1);
321320
} else {
322321
// end of move
323-
self.last_action_end = mdf.time.Absolute.from_us(0);
324-
self.next_action_interval = mdf.time.Duration.from_us(0);
322+
self.last_action_end = .from_us(0);
323+
self.next_action_interval = .from_us(0);
325324
}
326325
return self.next_action_interval;
327326
}

examples/build.zig.zon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.{
2-
.name = "examples",
2+
.name = .examples,
3+
.fingerprint = 0x7bd0ad455b19df59,
34
.version = "0.0.0",
45
.dependencies = .{
56
// examples
6-
.@"espressif/esp" = .{ .path = "espressif/esp" },
7+
.@"espressif/esp" = .{ .path = "espressif/esp" },
78
.@"gigadevice/gd32" = .{ .path = "gigadevice/gd32" },
89
.@"microchip/atsam" = .{ .path = "microchip/atsam" },
910
.@"microchip/avr" = .{ .path = "microchip/avr" },

examples/espressif/esp/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/espressif/esp",
2+
.name = .examples_espressif_esp,
3+
.fingerprint = 0xa568458fa3375cb1,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/gigadevice/gd32/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/gigadevice/gd32",
2+
.name = .examples_gigadevice_gd32,
3+
.fingerprint = 0x108c715b1d663409,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

examples/microchip/atsam/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.{
2-
.name = "examples/microchip/atsam",
2+
.name = .examples_microchip_atsam,
3+
.fingerprint = 0x43dbad7fe1a6b6e2,
34
.version = "0.0.0",
45
.dependencies = .{
56
.microzig = .{ .path = "../../.." },

0 commit comments

Comments
 (0)