Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions firmware/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,24 @@ int main() {

picoemp_init();

//Test LED
// All ON for 1s and then all OFF
gpio_put(PIN_LED_HV, true);
gpio_put(PIN_LED_STATUS, true);
gpio_put(PIN_LED_CHARGE_ON, true);
sleep_ms(1000);
gpio_put(PIN_LED_HV, false);
gpio_put(PIN_LED_STATUS, false);
gpio_put(PIN_LED_CHARGE_ON, false);

// Init for reset pin (move somewhere else)
gpio_init(1);
gpio_set_dir(1, GPIO_OUT);
gpio_put(1, 1);

//Now initialization is really complete, we can power on STATUS
gpio_put(PIN_LED_STATUS, true);

// Run serial-console on second core
multicore_launch_core1(serial_console);

Expand Down
5 changes: 1 addition & 4 deletions firmware/c/picoemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ void picoemp_init() {
gpio_set_dir(PIN_LED_HV, GPIO_OUT);
gpio_set_dir(PIN_LED_STATUS, GPIO_OUT);
gpio_set_dir(PIN_LED_CHARGE_ON, GPIO_OUT);
// Enable status LED
gpio_put(PIN_LED_STATUS, true);


// Initialize button GPIOs
gpio_init(PIN_BTN_ARM);
gpio_init(PIN_BTN_PULSE);
Expand All @@ -119,7 +117,6 @@ void picoemp_init() {
// Invert PULSE input so we can read ARM & PULSE both as active-high
gpio_set_inover(PIN_BTN_PULSE, GPIO_OVERRIDE_INVERT);


// Charge-detection coming from HV side
gpio_init(PIN_IN_CHARGED);
gpio_set_dir(PIN_IN_CHARGED, GPIO_IN);
Expand Down