Skip to content

Commit

Permalink
move 1-wire and I2C preflight sanity check to RESET and START command…
Browse files Browse the repository at this point in the history
…s only.
  • Loading branch information
DESKTOP-M9CCUTI\ian committed Dec 5, 2024
1 parent d5c5b78 commit 476473b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/mode/hw1wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ uint32_t hw1wire_setup_exc(void) {
}

bool hw1wire_preflight_sanity_check(void) {
return ui_help_sanity_check(true, 1<<M_OW_OWD);
//return ui_help_sanity_check(true, 1<<M_OW_OWD);
return true;
}

void hw1wire_start(struct _bytecode* result, struct _bytecode* next) {
result->data_message = GET_T(T_HW1WIRE_RESET);

ui_help_sanity_check(true, 1<<M_OW_OWD);

#ifdef BP_OLD_HW1WIRE
uint8_t device_detect = onewire_reset();
#else
Expand Down
4 changes: 3 additions & 1 deletion src/mode/hwi2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ uint32_t hwi2c_setup_exc(void) {
}

bool hwi2c_preflight_sanity_check(void) {
return ui_help_sanity_check(true, 1<<M_I2C_SDA|1<<M_I2C_SCL);
//return ui_help_sanity_check(true, 1<<M_I2C_SDA|1<<M_I2C_SCL);
return true;
}

bool hwi2c_error(hwi2c_status_t error, struct _bytecode* result) {
Expand All @@ -159,6 +160,7 @@ void hwi2c_start(struct _bytecode* result, struct _bytecode* next) {

hwi2c_status_t i2c_status;
if(!mode_config.start_sent) {
ui_help_sanity_check(true, 1<<M_I2C_SDA|1<<M_I2C_SCL);
result->data_message = GET_T(T_HWI2C_START);
i2c_status = pio_i2c_start_timeout(0xfffff);
}else{
Expand Down

0 comments on commit 476473b

Please sign in to comment.