mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Cleanup FUSB setup
This commit is contained in:
@@ -127,10 +127,10 @@ bool fusb_setup() {
|
||||
}
|
||||
/* Fully reset the FUSB302B */
|
||||
fusb_write_byte(FUSB_RESET, FUSB_RESET_SW_RES);
|
||||
osDelay(2);
|
||||
vTaskDelay(TICKS_10MS);
|
||||
uint8_t tries = 0;
|
||||
while (!fusb_read_id()) {
|
||||
osDelay(10);
|
||||
vTaskDelay(TICKS_10MS);
|
||||
tries++;
|
||||
if (tries > 5) {
|
||||
return false; // Welp :(
|
||||
@@ -156,12 +156,12 @@ bool fusb_setup() {
|
||||
|
||||
/* Measure CC1 */
|
||||
fusb_write_byte(FUSB_SWITCHES0, 0x07);
|
||||
osDelay(10);
|
||||
vTaskDelay(TICKS_10MS);
|
||||
uint8_t cc1 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
|
||||
|
||||
/* Measure CC2 */
|
||||
fusb_write_byte(FUSB_SWITCHES0, 0x0B);
|
||||
osDelay(10);
|
||||
vTaskDelay(TICKS_10MS);
|
||||
uint8_t cc2 = fusb_read_byte(FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
|
||||
|
||||
/* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
|
||||
|
||||
Reference in New Issue
Block a user