mirror of
https://github.com/cecio/USBvalve.git
synced 2025-12-06 03:41:45 +00:00
bump to release 0.14.0
This commit is contained in:
@@ -163,7 +163,7 @@ I grouped most of the variables you may want to modify in this section ([see Doc
|
||||
Obviously you can also build your own firmware. To build the *standard* one I used:
|
||||
|
||||
- Arduino IDE `2.2.1`
|
||||
- `Adafruit TinyUSB Library` version `2.2.3`, Board `Raspberry Pi RP2040 (3.6.0)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
|
||||
- `Adafruit TinyUSB Library` version `2.2.5`, Board `Raspberry Pi RP2040 (3.6.0)` setting Tools=>CPU Speed at `120MHz` and Tools=>USB Stack to `Adafruit TinyUSB`
|
||||
- `ssd1306` OLED library version `1.8.3`
|
||||
|
||||
If you want to re-create a new fake filesystem, you may want to have a look to the `utils` folder, where I placed some utilities to build a new one.
|
||||
|
||||
@@ -75,11 +75,13 @@ bool activeState = false;
|
||||
//
|
||||
// USBvalve globals
|
||||
//
|
||||
#define VERSION "USBvalve - 0.13.1"
|
||||
#define VERSION "USBvalve - 0.14.0"
|
||||
boolean readme = false;
|
||||
boolean autorun = false;
|
||||
boolean written = false;
|
||||
boolean deleted = false;
|
||||
boolean written_reported = false;
|
||||
boolean deleted_reported = false;
|
||||
boolean hid_sent = false;
|
||||
boolean hid_reported = false;
|
||||
|
||||
@@ -211,6 +213,12 @@ void loop() {
|
||||
autorun = false;
|
||||
}
|
||||
|
||||
if (deleted == true && deleted_reported == false) {
|
||||
oled.print("\n[!] DELETING");
|
||||
deleted = false;
|
||||
deleted_reported = true;
|
||||
}
|
||||
|
||||
if (written == true && written_reported == false) {
|
||||
oled.print("\n[!] WRITING");
|
||||
written = false;
|
||||
@@ -275,14 +283,25 @@ int32_t msc_read_callback(uint32_t lba, void* buffer, uint32_t bufsize) {
|
||||
// This happens only for the "real" size of disk
|
||||
int32_t msc_write_callback(uint32_t lba, uint8_t* buffer, uint32_t bufsize) {
|
||||
|
||||
// Check for file deletion at Block 7
|
||||
// The first char of filename is replaced with 0xE5, we are going
|
||||
// to check for it
|
||||
if (lba == 7) {
|
||||
if (buffer[32] == 0xE5 || buffer[64] == 0xE5 || buffer[160] == 0xE5) {
|
||||
deleted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// This check for writing of space. The LBA > 10 is set to avoid some
|
||||
// false positives, in particular on Windows Systems
|
||||
if (lba > 10) {
|
||||
written = true;
|
||||
}
|
||||
|
||||
// We are declaring a bigger size than what is actually allocated, so
|
||||
// this is protecting our memory integrity
|
||||
if (lba < DISK_BLOCK_NUM - 1) {
|
||||
// Writing buffer to "disk"
|
||||
uint8_t* addr = msc_disk[lba];
|
||||
memcpy(addr, buffer, bufsize);
|
||||
}
|
||||
@@ -358,10 +377,10 @@ void hexDump(unsigned char* data, size_t size) {
|
||||
}
|
||||
|
||||
// Reset the Pico
|
||||
void swreset()
|
||||
{
|
||||
void swreset() {
|
||||
watchdog_enable(1500, 1);
|
||||
while(1);
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
// README.TXT
|
||||
// System Volume Information
|
||||
//
|
||||
// Files information are saved at Block 7
|
||||
//
|
||||
|
||||
// Keep 11 chars
|
||||
#define DISK_LABEL 'M', 'y', 'D', 'r', 'i', 'v', 'e', ' ', ' ', ' ', ' '
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user