From 9d2124387c0b48c7d008158de0194022a592813b Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 27 Apr 2021 19:54:56 +1000 Subject: [PATCH] Return if read actually worked for fusb --- source/Core/Drivers/FUSB302/fusb302b.cpp | 6 +++--- source/Core/Drivers/FUSB302/fusb302b.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Core/Drivers/FUSB302/fusb302b.cpp b/source/Core/Drivers/FUSB302/fusb302b.cpp index 63ef5baf..87a6b158 100644 --- a/source/Core/Drivers/FUSB302/fusb302b.cpp +++ b/source/Core/Drivers/FUSB302/fusb302b.cpp @@ -123,10 +123,10 @@ bool fusb_setup() { return true; } -void fusb_get_status(union fusb_status *status) { +bool fusb_get_status(union fusb_status *status) { /* Read the interrupt and status flags into status */ - fusb_read_buf(FUSB_STATUS0A, 7, status->bytes); + return fusb_read_buf(FUSB_STATUS0A, 7, status->bytes); } enum fusb_typec_current fusb_get_typec_current() { @@ -154,4 +154,4 @@ bool fusb_read_id() { if (version == 0 || version == 0xFF) return false; return true; -} \ No newline at end of file +} diff --git a/source/Core/Drivers/FUSB302/fusb302b.h b/source/Core/Drivers/FUSB302/fusb302b.h index 43910a4d..fcba5b6d 100644 --- a/source/Core/Drivers/FUSB302/fusb302b.h +++ b/source/Core/Drivers/FUSB302/fusb302b.h @@ -283,7 +283,7 @@ void fusb_send_hardrst(); /* * Read the FUSB302B status and interrupt flags into *status */ -void fusb_get_status(union fusb_status *status); +bool fusb_get_status(union fusb_status *status); /* * Read the FUSB302B BC_LVL as an enum fusb_typec_current