orion-rf7e4cfad
restructure to use rust source tree primarily
+80 −17
48 files changed
- A .cargo/config.toml +19 −0
- M .gitignore +3 −1
- A Cargo.toml +27 −0
- A build.rs +3 −0
- A compile_commands.json
- R lib/Adafruit_PN532/Adafruit_PN532.cpp → lib-arduino/Adafruit_PN532/Adafruit_PN532.cpp +0 −0
- R lib/Adafruit_PN532/Adafruit_PN532.h → lib-arduino/Adafruit_PN532/Adafruit_PN532.h +0 −0
- R lib/BleMouse/BleConnectionStatus.cpp → lib-arduino/BleMouse/BleConnectionStatus.cpp +0 −0
- R lib/BleMouse/BleConnectionStatus.h → lib-arduino/BleMouse/BleConnectionStatus.h +0 −0
- R lib/BleMouse/BleMouse.cpp → lib-arduino/BleMouse/BleMouse.cpp +0 −0
- R lib/BleMouse/BleMouse.h → lib-arduino/BleMouse/BleMouse.h +0 −0
- R lib/ELECHOUSE_CC1101/ELECHOUSE_CC1101_SRC_DRV.cpp → lib-arduino/ELECHOUSE_CC1101/ELECHOUSE_CC1101_SRC_DRV.cpp +0 −0
- R lib/ELECHOUSE_CC1101/ELECHOUSE_CC1101_SRC_DRV.h → lib-arduino/ELECHOUSE_CC1101/ELECHOUSE_CC1101_SRC_DRV.h +0 −0
- M platformio.ini +4 −0
- A rust-toolchain.toml +2 −0
- D rust/Cargo.lock +0 −7
- D rust/Cargo.toml +0 −6
- D rust/src/main.rs +0 −3
- A sdkconfig.defaults +12 −0
- R src/bluetooth/ble_mouse.cpp → src-arduino/bluetooth/ble_mouse.cpp +0 −0
- R src/bluetooth/ble_mouse.h → src-arduino/bluetooth/ble_mouse.h +0 −0
- R src/bluetooth/blescanner.cpp → src-arduino/bluetooth/blescanner.cpp +0 −0
- R src/bluetooth/blescanner.h → src-arduino/bluetooth/blescanner.h +0 −0
- R src/config.h → src-arduino/config.h +0 −0
- R src/hid/badusb.cpp → src-arduino/hid/badusb.cpp +0 −0
- R src/hid/badusb.h → src-arduino/hid/badusb.h +0 −0
- R src/main.cpp → src-arduino/main.cpp +0 −0
- R src/nfc/nfc.cpp → src-arduino/nfc/nfc.cpp +0 −0
- R src/nfc/nfc.h → src-arduino/nfc/nfc.h +0 −0
- R src/rf/cc1101.cpp → src-arduino/rf/cc1101.cpp +0 −0
- R src/rf/cc1101.h → src-arduino/rf/cc1101.h +0 −0
- R src/rf/nrf24.cpp → src-arduino/rf/nrf24.cpp +0 −0
- R src/rf/nrf24.h → src-arduino/rf/nrf24.h +0 −0
- R src/ui/display.cpp → src-arduino/ui/display.cpp +0 −0
- R src/ui/display.h → src-arduino/ui/display.h +0 −0
- R src/ui/menu.cpp → src-arduino/ui/menu.cpp +0 −0
- R src/ui/menu.h → src-arduino/ui/menu.h +0 −0
- R src/utils/buttons.cpp → src-arduino/utils/buttons.cpp +0 −0
- R src/utils/buttons.h → src-arduino/utils/buttons.h +0 −0
- R src/utils/device_check.cpp → src-arduino/utils/device_check.cpp +0 −0
- R src/utils/device_check.h → src-arduino/utils/device_check.h +0 −0
- R src/utils/sysinfo.cpp → src-arduino/utils/sysinfo.cpp +0 −0
- R src/utils/sysinfo.h → src-arduino/utils/sysinfo.h +0 −0
- R src/wifi/wifi_analyzer.cpp → src-arduino/wifi/wifi_analyzer.cpp +0 −0
- R src/wifi/wifi_analyzer.h → src-arduino/wifi/wifi_analyzer.h +0 −0
- R src/wifi/wifi_scan.cpp → src-arduino/wifi/wifi_scan.cpp +0 −0
- R src/wifi/wifi_scan.h → src-arduino/wifi/wifi_scan.h +0 −0
- A src/main.rs +10 −0
| @@ -0,0 +1,19 @@ | |||
| 1 | + | [build] | |
| 2 | + | target = "xtensa-esp32s3-espidf" | |
| 3 | + | ||
| 4 | + | [target.'cfg(target_os = "espidf")'] | |
| 5 | + | linker = "ldproxy" | |
| 6 | + | runner = "espflash flash --monitor" | |
| 7 | + | rustflags = [ "--cfg", "espidf_time64"] | |
| 8 | + | ||
| 9 | + | [unstable] | |
| 10 | + | build-std = ["std", "panic_abort"] | |
| 11 | + | ||
| 12 | + | [env] | |
| 13 | + | MCU = "esp32s3" | |
| 14 | + | ESP_IDF_VERSION = "v5.5.3" | |
| 15 | + | ESP_IDF_TOOLS_INSTALL_DIR = "workspace" | |
| 16 | + | ||
| 17 | + | # Uncomment this if you have moved the target dir by setting CARGO_TARGET_DIR or similar. | |
| 18 | + | # Required for now due to embuild limitations. | |
| 19 | + | #CARGO_WORKSPACE_DIR = { value = "", relative = true } | |
| @@ -1,5 +1,7 @@ | |||
| 1 | 1 | # Rust firmware target | |
| 2 | − | rust/target | |
| 2 | + | /.embuild | |
| 3 | + | /target | |
| 4 | + | /Cargo.lock | |
| 3 | 5 | ||
| 4 | 6 | # Clangd cache | |
| 5 | 7 | .cache | |
| @@ -0,0 +1,27 @@ | |||
| 1 | + | [package] | |
| 2 | + | name = "orion-rf" | |
| 3 | + | version = "0.1.0" | |
| 4 | + | authors = ["krolyxon <me@krolyxon.com>"] | |
| 5 | + | edition = "2021" | |
| 6 | + | resolver = "2" | |
| 7 | + | rust-version = "1.82" | |
| 8 | + | ||
| 9 | + | [[bin]] | |
| 10 | + | name = "orion-rf" | |
| 11 | + | harness = false # do not use the built-in cargo test harness -> resolve rust-analyzer errors | |
| 12 | + | ||
| 13 | + | [profile.release] | |
| 14 | + | opt-level = "s" | |
| 15 | + | ||
| 16 | + | [profile.dev] | |
| 17 | + | debug = true # Symbols are nice, and they don't increase the size on Flash | |
| 18 | + | opt-level = "z" | |
| 19 | + | ||
| 20 | + | [dependencies] | |
| 21 | + | log = "0.4" | |
| 22 | + | esp-idf-svc = { version = "0.52.1", features = ["critical-section", "embassy-time-driver", "embassy-sync"] } | |
| 23 | + | # Remove `generic-queue-8` if you plan to use `embassy-time` WITH `embassy-executor` | |
| 24 | + | embassy-time = { version = "0.5", features = ["generic-queue-8"] } | |
| 25 | + | ||
| 26 | + | [build-dependencies] | |
| 27 | + | embuild = "0.33" | |
| @@ -0,0 +1,3 @@ | |||
| 1 | + | fn main() { | |
| 2 | + | embuild::espidf::sysenv::output(); | |
| 3 | + | } | |
[Diff too large] View file
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
| @@ -1,3 +1,7 @@ | |||
| 1 | + | [platformio] | |
| 2 | + | src_dir = src-arduino | |
| 3 | + | lib_dir = lib-arduino | |
| 4 | + | ||
| 1 | 5 | [env:esp32-s3-n16r8] | |
| 2 | 6 | platform = espressif32 | |
| 3 | 7 | board = esp32-s3-devkitc-1 | |
| @@ -0,0 +1,2 @@ | |||
| 1 | + | [toolchain] | |
| 2 | + | channel = "esp" | |
| @@ -1,7 +0,0 @@ | |||
| 1 | − | # This file is automatically @generated by Cargo. | |
| 2 | − | # It is not intended for manual editing. | |
| 3 | − | version = 4 | |
| 4 | − | ||
| 5 | − | [[package]] | |
| 6 | − | name = "orion-rf" | |
| 7 | − | version = "0.1.0" | |
| @@ -1,6 +0,0 @@ | |||
| 1 | − | [package] | |
| 2 | − | name = "orion-rf" | |
| 3 | − | version = "0.1.0" | |
| 4 | − | edition = "2024" | |
| 5 | − | ||
| 6 | − | [dependencies] | |
| @@ -1,3 +0,0 @@ | |||
| 1 | − | fn main() { | |
| 2 | − | println!("Hello, world!"); | |
| 3 | − | } | |
| @@ -0,0 +1,12 @@ | |||
| 1 | + | # Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) | |
| 2 | + | # You might have to increase this further if you allocate large stack variables in the main task | |
| 3 | + | CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 | |
| 4 | + | ||
| 5 | + | # Increase a bit these stack sizes as they are also a bit too small by default | |
| 6 | + | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 | |
| 7 | + | CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=4096 | |
| 8 | + | ||
| 9 | + | # You might have to increase this further if you spawn your own Rust threads | |
| 10 | + | # that allocate large stack variables; or better yet - use | |
| 11 | + | # `std::thread::Builder::new().stack_size(XXX)` for spawning | |
| 12 | + | CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=4096 | |
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
[No content changes]
| @@ -0,0 +1,10 @@ | |||
| 1 | + | fn main() { | |
| 2 | + | // It is necessary to call this function once. Otherwise, some patches to the runtime | |
| 3 | + | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 | |
| 4 | + | esp_idf_svc::sys::link_patches(); | |
| 5 | + | ||
| 6 | + | // Bind the log crate to the ESP Logging facilities | |
| 7 | + | esp_idf_svc::log::EspLogger::initialize_default(); | |
| 8 | + | ||
| 9 | + | log::info!("Hello, world!"); | |
| 10 | + | } | |