Fix watchdog timeouts && get unit to boot
This commit is contained in:
@@ -152,14 +152,21 @@ void fusb_setup() {
|
||||
/* Flush the RX buffer */
|
||||
fusb_write_byte( FUSB_CONTROL1, FUSB_CONTROL1_RX_FLUSH);
|
||||
|
||||
resetWatchdog();
|
||||
/* Measure CC1 */
|
||||
fusb_write_byte( FUSB_SWITCHES0, 0x07);
|
||||
osDelay(1);
|
||||
resetWatchdog();
|
||||
delay_ms(1);
|
||||
resetWatchdog();
|
||||
uint8_t cc1 = fusb_read_byte( FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
|
||||
resetWatchdog();
|
||||
|
||||
/* Measure CC2 */
|
||||
resetWatchdog();
|
||||
fusb_write_byte( FUSB_SWITCHES0, 0x0B);
|
||||
osDelay(1);
|
||||
resetWatchdog();
|
||||
delay_ms(1);
|
||||
resetWatchdog();
|
||||
uint8_t cc2 = fusb_read_byte( FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
|
||||
|
||||
/* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
|
||||
@@ -170,6 +177,7 @@ void fusb_setup() {
|
||||
fusb_write_byte( FUSB_SWITCHES1, 0x26);
|
||||
fusb_write_byte( FUSB_SWITCHES0, 0x0B);
|
||||
}
|
||||
resetWatchdog();
|
||||
|
||||
/* Reset the PD logic */
|
||||
fusb_write_byte( FUSB_RESET, FUSB_RESET_PD_RESET);
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include <pdb_msg.h>
|
||||
|
||||
/* I2C addresses of the FUSB302B chips */
|
||||
#define FUSB302B_ADDR 0x22
|
||||
#define FUSB302B01_ADDR 0x23
|
||||
#define FUSB302B10_ADDR 0x24
|
||||
#define FUSB302B11_ADDR 0x25
|
||||
#define FUSB302B_ADDR (0x22<<1)
|
||||
#define FUSB302B01_ADDR (0x23<<1)
|
||||
#define FUSB302B10_ADDR (0x24<<1)
|
||||
#define FUSB302B11_ADDR (0x25<<1)
|
||||
|
||||
/* Device ID register */
|
||||
#define FUSB_DEVICE_ID 0x01
|
||||
|
||||
Reference in New Issue
Block a user