Skip to content

Commit 00df5b4

Browse files
committed
Move non-init stuff to main()
1 parent 3bf91a2 commit 00df5b4

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

  • src/board/system76/common

src/board/system76/common/main.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -302,19 +302,6 @@ void init(void) {
302302
// Must happen last
303303
power_init();
304304
board_init();
305-
306-
// Set the initial lid and AC states
307-
lid_event();
308-
acin_event();
309-
310-
// Sequence the board to the initial state
311-
usbpd_event();
312-
// If we were woken by power button, power on.
313-
if (!gpio_get(&PWR_SW_N))
314-
power_on();
315-
else
316-
power_off();
317-
update_power_state();
318305
}
319306

320307
void main(void) {
@@ -329,6 +316,19 @@ void main(void) {
329316
INFO("System76 EC board '%s', version '%s'\n", board(), version());
330317
ec_print_reset_reason();
331318

319+
// Set the initial lid and AC states
320+
lid_event();
321+
acin_event();
322+
323+
// Sequence the board to the initial state
324+
usbpd_event();
325+
// If we were woken by power button, power on.
326+
if (!gpio_get(&PWR_SW_N))
327+
power_on();
328+
else
329+
power_off();
330+
update_power_state();
331+
332332
for (main_cycle = 0;; main_cycle++) {
333333
// Idle until next interrupt (~1ms timer_0 or INTC wakeup)
334334
PCON |= 1;

0 commit comments

Comments
 (0)