From e6cc0e3338bc735bfe8afdf3ea4e22122efe93c5 Mon Sep 17 00:00:00 2001 From: kf Date: Thu, 25 Jun 2026 13:44:28 +0900 Subject: [PATCH 1/3] fix: `mcl_version` print correct version --- build.zig | 1 + src/command/mcl.zig | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index 6350c2e..a0f8832 100644 --- a/build.zig +++ b/build.zig @@ -35,6 +35,7 @@ pub fn build(b: *std.Build) !void { const imports: []const std.Build.Module.Import = &.{ .{ .name = "build.zig.zon", .module = build_zig_zon }, .{ .name = "chrono", .module = chrono.module("chrono") }, + .{ .name = "mmc_api", .module = mmc_api.module("mmc-api") }, }; const mod = b.createModule(.{ diff --git a/src/command/mcl.zig b/src/command/mcl.zig index ac6c28d..03f3ae0 100644 --- a/src/command/mcl.zig +++ b/src/command/mcl.zig @@ -1,6 +1,7 @@ const std = @import("std"); const command = @import("../command.zig"); const mcl = @import("mcl"); +const mmc_api = @import("mmc_api"); var arena: std.heap.ArenaAllocator = undefined; var gpa: std.mem.Allocator = undefined; @@ -42,10 +43,10 @@ pub fn init(c: Config) !void { try command.registry.put(gpa, "MCL_VERSION", .{ .name = "MCL_VERSION", - .short_description = "Display the version of MCL.", + .short_description = "Display the CC-Link version.", .long_description = - \\Print the currently linked version of the PMF Motion Control Library - \\in Semantic Version format. + \\Print the currently linked version of the CC-Link in Semantic Version + \\format. , .execute = &mclVersion, }); @@ -743,10 +744,10 @@ pub fn deinit() void { } fn mclVersion(_: std.Io, _: std.mem.Allocator, _: [][]const u8) !void { - std.log.info("MCL Version: {d}.{d}.{d}\n", .{ - mcl.version.major, - mcl.version.minor, - mcl.version.patch, + std.log.info("CC-Link Version: {d}.{d}.{d}\n", .{ + mmc_api.cclink.version.major, + mmc_api.cclink.version.minor, + mmc_api.cclink.version.patch, }); } From 694c7fc480b2aea0120feb44df1737547622a1f5 Mon Sep 17 00:00:00 2001 From: kf Date: Thu, 25 Jun 2026 14:28:14 +0900 Subject: [PATCH 2/3] refactor: split mmc_api imports --- build.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index a0f8832..ef8a2a9 100644 --- a/build.zig +++ b/build.zig @@ -35,7 +35,6 @@ pub fn build(b: *std.Build) !void { const imports: []const std.Build.Module.Import = &.{ .{ .name = "build.zig.zon", .module = build_zig_zon }, .{ .name = "chrono", .module = chrono.module("chrono") }, - .{ .name = "mmc_api", .module = mmc_api.module("mmc-api") }, }; const mod = b.createModule(.{ @@ -51,6 +50,7 @@ pub fn build(b: *std.Build) !void { .root_module = mod, }); + exe.root_module.addImport("mmc_api", mmc_api.module("mmc-api")); exe.root_module.addImport("mcl", mmc_api.module("mcl")); b.installArtifact(exe); @@ -83,6 +83,7 @@ pub fn build(b: *std.Build) !void { }); const unit_tests = b.addTest(.{ .root_module = test_mod }); + unit_tests.root_module.addImport("mmc_api", mmc_api_mock.module("mmc-api")); unit_tests.root_module.addImport("mcl", mmc_api_mock.module("mcl")); const run_unit_tests = b.addRunArtifact(unit_tests); From 2d9b2518ad129904dd1a9e21aa81df0221ea34ab Mon Sep 17 00:00:00 2001 From: kf Date: Thu, 25 Jun 2026 16:54:24 +0900 Subject: [PATCH 3/3] ci: Enable action targetting `CTO_firmware` --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a8ab3b..1ff1007 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,10 +5,12 @@ on: branches: - main - chain_commands + - CTO_firmware pull_request: branches: - main - chain_commands + - CTO_firmware workflow_dispatch: jobs: