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 <alistair.francis@wdc.com>
  • Loading branch information
alistair23 committed Nov 28, 2024
1 parent c1c92fb commit 576740f
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 576740f

Please sign in to comment.