diff --git a/README.md b/README.md index 8b0e24b..4e6dfd2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ -# SonixFlasherC -Dead Simple flasher. +# Sonix Flasher C + +A CLI-based Flasher for Sonix 24x/26x MCUs. + +## Description + +This flasher is aimed for advanced users that don't need a GUI. If you require a GUI please use: [Sonix-Flaser](https://github.com/SonixQMK/sonix-flasher). + +Features: + +- [x] Minimal dependencies +- [x] Cross-platform +- [x] Faster + +## Getting Started + +### Dependencies + +Clone this repository recursively: +``` +git clone --recursive https://github.com/SonixQMK/SonixFlasherC +``` + +If using windows, please install MinGW + +### Compiling + +Compile using: + +``` +make sonixflasher +``` + + +### Running the flasher + +``` +./sonixflasher +``` + + +## License + +This project is licensed under the GNU License - see the LICENSE.md file for details diff --git a/sonixflasher.c b/sonixflasher.c index 802b3df..cf561de 100644 --- a/sonixflasher.c +++ b/sonixflasher.c @@ -375,6 +375,9 @@ int main(int argc, char* argv[]) if(vid != SONIX_VID || (pid != SN248_PID && pid != SN248B_PID && pid != SN268_PID)) { printf("Warning: Flashing a non-sonix device, you are now on your own.\n"); + + // Set max firmware to 64k, useful when flashing a Sonix Board that isnt in BL mode (Redragons, Keychrons) + MAX_FIRMWARE = MAX_FIRMWARE_SN32F240; // Maybe add a param to override this (?) } // Set max fw size depending on VID/PID @@ -403,7 +406,7 @@ int main(int argc, char* argv[]) } } - while (file_size % 64 != 0) file_size++; // Add padded zereos (if any) to file_size + while (file_size % 64 != 0) file_size++; // Add padded zereos (if any) to file_size, since we are using a fixed 64 + 1 buffer, we need to take in consideration when the file doesnt fill the buffer. if( ((flash_jumploader && sanity_check_jumploader_firmware(file_size)) || (!flash_jumploader && sanity_check_firmware(file_size, offset))) &&