* Very hacky first attempt at usermod ech341

* Fixes and debug printfs

* Move to library version of libpinedio-usb

* Add spidev: ch341 option in meshtasticd config.yaml

* Only check settingsStrings on native

* Use new CH341 code

* Bump ch341 lib

* Cleanup USBHal

* Add ch341 config.d files

* Remove ch341quirk

* Bump to most recent spi-userspace driver

* Add handling for ch341 serial, pid, and vid

* Minor fixes from pio check

* Trunk

* Add include for musl compliance

* Point to upstream libch341
This commit is contained in:
Jonathan Bennett
2024-12-20 17:34:02 -06:00
committed by GitHub
parent 658459aaf3
commit 960626e498
10 changed files with 326 additions and 104 deletions
+7 -2
View File
@@ -2,6 +2,8 @@
#include <fstream>
#include <map>
#include "platform/portduino/USBHal.h"
enum configNames {
use_sx1262,
cs,
@@ -13,13 +15,15 @@ enum configNames {
rxen,
dio2_as_rf_switch,
dio3_tcxo_voltage,
ch341Quirk,
use_rf95,
use_sx1280,
use_lr1110,
use_lr1120,
use_lr1121,
use_sx1268,
lora_usb_serial_num,
lora_usb_pid,
lora_usb_vid,
user,
gpiochip,
spidev,
@@ -69,8 +73,9 @@ enum { level_error, level_warn, level_info, level_debug, level_trace };
extern std::map<configNames, int> settingsMap;
extern std::map<configNames, std::string> settingsStrings;
extern std::ofstream traceFile;
extern Ch341Hal *ch341Hal;
int initGPIOPin(int pinNum, std::string gpioChipname);
bool loadConfig(const char *configPath);
static bool ends_with(std::string_view str, std::string_view suffix);
void getMacAddr(uint8_t *dmac);
bool MAC_from_string(std::string mac_str, uint8_t *dmac);
bool MAC_from_string(std::string mac_str, uint8_t *dmac);