Skip to content

Commit

Permalink
Disable the from usb event logic (#1462)
Browse files Browse the repository at this point in the history
Issue: #1461
  • Loading branch information
beastoin authored Dec 3, 2024
2 parents cad748d + b28264f commit 8a57c6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CONFIG_BT_DIS_MODEL="Omi DevKit 2"
CONFIG_BT_DIS_MANUF="Based Hardware"
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_HW_REV=y
CONFIG_BT_DIS_FW_REV_STR="2.0.5"
CONFIG_BT_DIS_FW_REV_STR="2.0.6"
CONFIG_BT_DIS_HW_REV_STR="Seeed Xiao BLE Sense"

#
Expand Down
29 changes: 16 additions & 13 deletions Friend/firmware/firmware_v1.0/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,30 +134,33 @@ void set_led_state()

}
bool from_wakeup = false;

// Main loop
int main(void)
{
int err;
//for system power off, we have no choice but to handle usb detect wakeup events. if off, and this was the reason, initialize, skip lightshow, start not recording
// TODO: what does it mean ? disabled from_usb_event for now
// for system power off, we have no choice but to handle usb detect wakeup events. if off, and this was the reason, initialize, skip lightshow, start not recording
uint32_t reset_reas = NRF_POWER->RESETREAS;
NRF_POWER->DCDCEN=1;
NRF_POWER->DCDCEN0=1;

NRF_POWER->RESETREAS=1;
bool from_usb_event = (reset_reas & VBUS_DETECT);
// bool from_usb_event = (reset_reas & VBUS_DETECT);
bool from_wakeup = (reset_reas & WAKEUP_DETECT);
if (from_usb_event)
{
k_msleep(100);
printf("from reset \n");
is_off = true;
// if (from_usb_event)
// {
// k_msleep(100);
// printf("from reset \n");
// is_off = true;

// usb_charge = true;
activate_everything_no_lights();
// bt_disable();
bt_off();
}
else if (from_wakeup)
// // usb_charge = true;
// activate_everything_no_lights();
// // bt_disable();
// bt_off();
// }
//else if (from_wakeup)
if (from_wakeup)
{

is_off = false;
Expand Down

0 comments on commit 8a57c6f

Please sign in to comment.