diff --git a/README.md b/README.md index 587a51e..fe1d669 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,12 @@ Tweak framerate or MAX_ERROR in `main.rs` until the total size fits the 16k flas By default it's tuned for bad apple. +## building ch32_decoder +If you are not on Linux, good luck. + +You will need [ch32v003fun](https://github.com/cnlohr/ch32v003fun/) in next to the folder for this repository. + +The `gdbinit` file contains the device path for uploading via a Pi Pico with [PicoRVD](https://github.com/aappleby/PicoRVD). This is triggered with `make flash`. + +If you have an official WCH programmer you can probably run `make cv_flash` to use minchlink from ch32v003fun, but I can't test this. + diff --git a/encoder/src/main.rs b/encoder/src/main.rs index c07803c..feeb739 100644 --- a/encoder/src/main.rs +++ b/encoder/src/main.rs @@ -63,7 +63,7 @@ fn main() { ); let mut export_string = String::from("// Generated by the `encoder` rust app\n"); - export_string += "typedef enum {\n"; + export_string += "typedef enum Encoding {\n"; for (encoding, count) in stats { if count > 0 { export_string += &format!("\tEncoding_{encoding:?} = {},\n", encoding as u8); @@ -81,7 +81,7 @@ fn main() { export_string += &format!("{byte},"); } export_string += "\n};\n"; - let mut file = File::create("../data.h").unwrap(); + let mut file = File::create("../ch32_decoder/data.h").unwrap(); file.write_all(export_string.as_bytes()).unwrap(); }