Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add io_seproxyhal_enable_io() function #450

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/os_io_seproxyhal.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ void io_seproxyhal_setup_ticker(unsigned int interval_ms);
void io_seproxyhal_power_off(bool criticalBattery);
void io_seproxyhal_se_reset(void);
void io_seproxyhal_disable_io(void);
void io_seproxyhal_enable_io(void);

#ifdef HAVE_PIEZO_SOUND
typedef enum tune_index_e {
Expand Down
14 changes: 14 additions & 0 deletions src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,12 +1111,26 @@ static const unsigned char seph_io_usb_disconnect[] = {
1,
SEPROXYHAL_TAG_USB_CONFIG_DISCONNECT,
};

void io_seproxyhal_disable_io(void)
{
// usb off
io_seproxyhal_spi_send(seph_io_usb_disconnect, sizeof(seph_io_usb_disconnect));
}

static const unsigned char seph_io_usb_connect[] = {
SEPROXYHAL_TAG_USB_CONFIG,
0,
1,
SEPROXYHAL_TAG_USB_CONFIG_CONNECT,
};

void io_seproxyhal_enable_io(void)
{
// usb on
io_seproxyhal_spi_send(seph_io_usb_connect, sizeof(seph_io_usb_connect));
}

void io_seproxyhal_backlight(unsigned int flags, unsigned int backlight_percentage)
{
G_io_seproxyhal_spi_buffer[0] = SEPROXYHAL_TAG_SET_SCREEN_CONFIG;
Expand Down