diff --git a/microcontrollers/RP2040W/backend-sdcard-rp2040w.cpp b/microcontrollers/RP2040W/backend-sdcard-rp2040w.cpp index 7569a24..89ba056 100644 --- a/microcontrollers/RP2040W/backend-sdcard-rp2040w.cpp +++ b/microcontrollers/RP2040W/backend-sdcard-rp2040w.cpp @@ -3,6 +3,7 @@ #include #include "backend-sdcard-rp2040w.h" +#include "gen.h" #include "log.h" #include "utils.h" @@ -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; +} diff --git a/microcontrollers/RP2040W/backend-sdcard-rp2040w.h b/microcontrollers/RP2040W/backend-sdcard-rp2040w.h index ee4d159..fab8357 100644 --- a/microcontrollers/RP2040W/backend-sdcard-rp2040w.h +++ b/microcontrollers/RP2040W/backend-sdcard-rp2040w.h @@ -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; diff --git a/microcontrollers/RP2040W/main.ino b/microcontrollers/RP2040W/main.ino index b89188b..d258033 100644 --- a/microcontrollers/RP2040W/main.ino +++ b/microcontrollers/RP2040W/main.ino @@ -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() { diff --git a/scsi.cpp b/scsi.cpp index faedc02..dff9d50 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -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; @@ -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 @@ -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