Skip to content

Commit

Permalink
Tweak buffer sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 28, 2023
1 parent 2118d6f commit 5edc74f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/board/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ pub struct MiscPins {
}

pub struct HttpClientResources {
pub client_state: TcpClientState<1, 1024, 1024>,
pub rx_buffer: [u8; 1024],
pub client_state: TcpClientState<1, 4096, 4096>,
pub rx_buffer: [u8; 512],
}

impl HttpClientResources {
pub fn new_boxed() -> Box<Self> {
Box::new(Self {
client_state: TcpClientState::new(),
rx_buffer: [0; 1024],
rx_buffer: [0; 512],
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/states/firmware_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async fn do_update(board: &mut Board) -> UpdateResult {

let size = response.content_length;
let mut current = 0;
let mut buffer = [0; 1024];
let mut buffer = [0; 512];

print_progress(board, &mut buffer, current, size).await;

Expand Down
5 changes: 1 addition & 4 deletions src/states/upload_or_store_measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ async fn upload_stored(board: &mut Board) -> bool {

let mut fn_buffer = [0; 64];

let mut resources = Box::new(HttpClientResources {
client_state: TcpClientState::new(),
rx_buffer: [0; 1024],
});
let mut resources = HttpClientResources::new_boxed();

let client = TcpClient::new(sta.stack(), &resources.client_state);
let dns = DnsSocket::new(sta.stack());
Expand Down

0 comments on commit 5edc74f

Please sign in to comment.