Skip to content

Commit

Permalink
Merge pull request tock#4248 from alistair23/alistair/kv-update
Browse files Browse the repository at this point in the history
capsules: kv: Support 512 byte KV values
  • Loading branch information
alevy authored Dec 3, 2024
2 parents 42fa22b + 24f70ce commit 2cceb10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions boards/components/src/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ macro_rules! kv_driver_component_static {
($V:ty $(,)?) => {{
let kv = kernel::static_buf!(capsules_extra::kv_driver::KVStoreDriver<'static, $V>);
let key_buffer = kernel::static_buf!([u8; 64]);
let value_buffer = kernel::static_buf!([u8; 256]);
let value_buffer = kernel::static_buf!([u8; 512]);

(kv, key_buffer, value_buffer)
};};
Expand Down Expand Up @@ -52,15 +52,15 @@ impl<V: hil::kv::KVPermissions<'static>> Component for KVDriverComponent<V> {
type StaticInput = (
&'static mut MaybeUninit<KVStoreDriver<'static, V>>,
&'static mut MaybeUninit<[u8; 64]>,
&'static mut MaybeUninit<[u8; 256]>,
&'static mut MaybeUninit<[u8; 512]>,
);
type Output = &'static KVStoreDriver<'static, V>;

fn finalize(self, static_buffer: Self::StaticInput) -> Self::Output {
let grant_cap = create_capability!(capabilities::MemoryAllocationCapability);

let key_buffer = static_buffer.1.write([0; 64]);
let value_buffer = static_buffer.2.write([0; 256]);
let value_buffer = static_buffer.2.write([0; 512]);

let driver = static_buffer.0.write(KVStoreDriver::new(
self.kv,
Expand Down

0 comments on commit 2cceb10

Please sign in to comment.