Compare commits

..

No commits in common. "c428ee6294732a61948d9410f9eef5f725943d23" and "ca26f090fa9a4fc0dba71ad8dc71108efe29853d" have entirely different histories.

7 changed files with 24 additions and 5428 deletions

View File

@ -16460,6 +16460,16 @@
)
(uuid "234f63f9-9a2c-4be4-959e-c63254bdf769")
)
(text "All NPN are wrongly pined for common types!\n"
(exclude_from_sim no)
(at 508.508 215.646 0)
(effects
(font
(size 15 15)
)
)
(uuid "2d9b22f8-0267-40d2-b6ee-41daff296e78")
)
(text "ESP32"
(exclude_from_sim no)
(at 81.28 30.734 0)
@ -16514,16 +16524,6 @@
)
(uuid "491f884a-ca01-4332-91f5-1fdea04f1b4a")
)
(text "Change is solar pin? USB boot mode"
(exclude_from_sim no)
(at 286.766 551.688 0)
(effects
(font
(size 5 5)
)
)
(uuid "4ef2c8f1-2d7a-4d3c-a869-fae9e17e4c52")
)
(text "Low Power supply"
(exclude_from_sim no)
(at 140.97 182.88 0)

View File

@ -4,12 +4,11 @@ target = "riscv32imac-esp-espidf"
[target.riscv32imac-esp-espidf]
linker = "ldproxy"
runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
runner = "espflash flash --monitor --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
#runner = "cargo runner"
#runner = "espflash flash --monitor --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
# runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
# runner = espflash erase-parts otadata

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1078,7 +1078,7 @@ impl CreatePlantHal<'_> for PlantHal {
let config = I2cConfig::new()
.scl_enable_pullup(true)
.sda_enable_pullup(true)
.baudrate(400_u32.kHz().into())
.baudrate(1_u32.kHz().into())
.timeout(APBTickType::from(Duration::from_millis(100)));
let scl = peripherals.pins.gpio19.downgrade();
let sda = peripherals.pins.gpio20.downgrade();

View File

@ -295,7 +295,7 @@ pub fn shared() -> Box<EspHttpServer<'static>> {
server
.fn_handler("/flashbattery", Method::Post, move |mut request| {
let mut board = BOARD_ACCESS.lock().unwrap();
let mut buffer: [u8; 128] = [0; 128];
let mut buffer: [u8; 32] = [0; 32];
let mut line_buffer: VecDeque<u8> = VecDeque::new();
let is_dry_run = !request.uri().ends_with("?flash=true");
@ -307,6 +307,7 @@ pub fn shared() -> Box<EspHttpServer<'static>> {
delay.delay_us(2);
let read = request.read(&mut buffer).unwrap();
total_read += read;
println!("received {read} bytes ota {total_read}");
if read == 0 {
if line_buffer.len() > 0 {
println!("No further body but no endline");
@ -322,28 +323,29 @@ pub fn shared() -> Box<EspHttpServer<'static>> {
break;
}
let to_write = &buffer[0..read];
line_buffer.write_all(to_write).unwrap();
println!("Write to deque new lenght is {}", line_buffer.len());
board.general_fault(toggle);
toggle = !toggle;
println!("Updated btn");
loop {
println!("Check for line");
let has_line = line_buffer.contains(&b'\n');
if !has_line {
if has_line {
println!("Was no line no string read");
break;
}
let mut line = std::string::String::new();
line_buffer.read_line(&mut line)?;
let line2 = &line[0..line.len()-1];
println!("Processing dry:{} line {}", is_dry_run, line2);
let validate = board.flash_bq34_z100(&line2, is_dry_run);
let line_size = line_buffer.read_line(&mut line)?;
println!("Processing line with size {} {}", line_size, line);
let validate = board.flash_bq34_z100(&line, is_dry_run);
delay.delay_us(2);
if validate.is_err() {
let mut response = request.into_status_response(400_u16).unwrap();
let err = validate.unwrap_err();
let err_str = err.to_string();
let err_msg = err_str.as_bytes();
println!("Error writing {}", err_str);
response
.write(err_msg)
.unwrap();

View File

@ -33,9 +33,6 @@ ajax.addEventListener("abort", () => {
battery_flash_button.onclick = async function (){
//ajax.open("POST", "/flashbattery");
//ajax.send(battery_flash_file.files[0]);
ajax.open("POST", "/flashbattery?flash=true");
ajax.open("POST", "/flashbattery");
ajax.send(battery_flash_file.files[0]);
};