Skip to content

Commit

Permalink
RP2040W compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 26, 2024
1 parent c1e345b commit f1781e3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
6 changes: 6 additions & 0 deletions microcontrollers/RP2040W/backend-sdcard-rp2040w.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <unistd.h>

#include "backend-sdcard-rp2040w.h"
#include "gen.h"
#include "log.h"
#include "utils.h"

Expand Down Expand Up @@ -267,3 +268,8 @@ backend::cmpwrite_result_t backend_sdcard_rp2040w::cmpwrite(const uint64_t block

return result;
}

std::string backend_sdcard_rp2040w::get_serial() const
{
return DEFAULT_SERIAL;
}
5 changes: 3 additions & 2 deletions microcontrollers/RP2040W/backend-sdcard-rp2040w.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class backend_sdcard_rp2040w : public backend

bool begin() override;

uint64_t get_size_in_blocks() const override;
uint64_t get_block_size() const override;
std::string get_serial() const override;
uint64_t get_size_in_blocks() const override;
uint64_t get_block_size() const override;

bool sync() override;

Expand Down
20 changes: 10 additions & 10 deletions microcontrollers/RP2040W/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
#include "wifi.h"


std::atomic_bool stop { false };
com *c { nullptr };
std::atomic_bool stop { false };
com *c { nullptr };
backend_sdcard_rp2040w *bs { nullptr };
scsi *sd { nullptr };
server *s { nullptr };
iscsi_stats_t is;
io_stats_t ios;
volatile bool wifi_connected { false };
int led_green { 17 };
int led_yellow { 18 };
int led_red { -1 };
scsi *sd { nullptr };
server *s { nullptr };
iscsi_stats_t is;
io_stats_t ios;
volatile bool wifi_connected { false };
int led_green { 17 };
int led_yellow { 18 };
int led_red { -1 };

bool is_network_up()
{
Expand Down
12 changes: 6 additions & 6 deletions scsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ scsi_response scsi::inquiry(const std::string & identifier, const uint64_t lun,
}
else if (CDB[2] == 0xb0) { // block limits
response.io.is_inline = true;
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.first[0] = device_type;
response.io.what.data.first[1] = CDB[2];
response.io.what.data.first[2] = 0;
Expand All @@ -224,8 +224,8 @@ scsi_response scsi::inquiry(const std::string & identifier, const uint64_t lun,
}
else if (CDB[2] == 0xb1) { // block device characteristics
response.io.is_inline = true;
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.first[0] = device_type;
response.io.what.data.first[1] = CDB[2];
response.io.what.data.first[2] = (response.io.what.data.second - 4)>> 8; // page length
Expand All @@ -236,8 +236,8 @@ scsi_response scsi::inquiry(const std::string & identifier, const uint64_t lun,
}
else if (CDB[2] == 0xb2) { // logical block provisioning vpd page
response.io.is_inline = true;
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.second = 64;
response.io.what.data.first = new uint8_t[response.io.what.data.second]();
response.io.what.data.first[0] = device_type;
response.io.what.data.first[1] = CDB[2];
response.io.what.data.first[2] = (response.io.what.data.second - 4)>> 8; // page length
Expand Down

0 comments on commit f1781e3

Please sign in to comment.