diff options
Diffstat (limited to 'board/grunt/board.c')
-rw-r--r-- | board/grunt/board.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c index 597ff0fa10..1257a74a88 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -324,9 +324,17 @@ void board_reset_pd_mcu(void) void board_tcpc_init(void) { + int count = 0; int port; - /* TODO(ecgh): need to wait for disconnected battery? */ + /* Wait for disconnected battery to wake up */ + while (battery_hw_present() == BP_YES && + battery_is_present() == BP_NO) { + usleep(100 * MSEC); + /* Give up waiting after 1 second */ + if (++count > 10) + break; + } /* Only reset TCPC if not sysjump */ if (!system_jumped_to_this_image()) |