Skip to content

Commit

Permalink
capsules: kv: Support 512 byte KV values
Browse files Browse the repository at this point in the history
Some of the new LoRaWAN examples are writing more then 256 bytes, so
let's up the buffer size to allow larger payloads.

Signed-off-by: Alistair Francis <[email protected]>
  • Loading branch information
alistair23 committed Nov 22, 2024
1 parent a25d927 commit 24f70ce
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 24f70ce

Please sign in to comment.