@@ -6,6 +6,7 @@ const log = @import("../log.zig");
66const sddf = @import ("sddf.zig" );
77
88const fmt = sddf .fmt ;
9+ const assert = std .debug .assert ;
910
1011const Allocator = std .mem .Allocator ;
1112
@@ -17,14 +18,16 @@ const Channel = SystemDescription.Channel;
1718
1819const ConfigResources = data .Resources ;
1920
21+ const SystemError = sddf .SystemError ;
22+
2023pub const Gpio = struct {
2124 allocator : Allocator ,
2225 sdf : * SystemDescription ,
2326 driver : * Pd ,
2427 device : * dtb.Node ,
2528 device_res : ConfigResources.Device ,
26- clients : std .ArrayList (Client ),
27- client_configs : std .ArrayList (ConfigResources .Gpio .Client ),
29+ clients : std .array_list . Managed (Client ),
30+ client_configs : std .array_list . Managed (ConfigResources .Gpio .Client ),
2831 connected : bool = false ,
2932 serialised : bool = false ,
3033
@@ -54,8 +57,8 @@ pub const Gpio = struct {
5457 .driver = driver ,
5558 .device = device ,
5659 .device_res = std .mem .zeroInit (ConfigResources .Device , .{}),
57- .clients = std .ArrayList (Client ).init (allocator ),
58- .client_configs = std .ArrayList (ConfigResources .Gpio .Client ).init (allocator ),
60+ .clients = std .array_list . Managed (Client ).init (allocator ),
61+ .client_configs = std .array_list . Managed (ConfigResources .Gpio .Client ).init (allocator ),
5962 };
6063 }
6164
@@ -132,7 +135,7 @@ pub const Gpio = struct {
132135 // The driver must be passive
133136 assert (system .driver .passive .? );
134137
135- try createDriver (system .sdf , system .driver , system .device , .gpio , & system .device_res );
138+ try sddf . createDriver (system .sdf , system .driver , system .device , .gpio , & system .device_res );
136139
137140 // For each client...
138141 for (system .clients .items , 0.. ) | client , i | {
0 commit comments