change order of gpio ISR init

This commit is contained in:
Skot 2025-03-04 16:06:13 -05:00
parent d012fc32a3
commit 6e22963e09
4 changed files with 16 additions and 18 deletions

View File

@ -54,7 +54,6 @@ esp_err_t input_init(void (*button_short_clicked_cb)(void), void (*button_long_p
gpio_config(&io_conf);
// Install ISR service and hook the interrupt handler
ESP_RETURN_ON_ERROR(gpio_install_isr_service(0), TAG, "Error installing ISR service");
ESP_RETURN_ON_ERROR(gpio_isr_handler_add(GPIO_BUTTON_BOOT, button_isr_handler, NULL), TAG, "Error adding ISR handler");
lv_group_t * group = lv_group_create();

View File

@ -988,7 +988,6 @@ esp_err_t TPS546_init_fault_interrupt(void * isr_handler, void * global_state) {
gpio_config(&io_conf);
// Install ISR service and hook the interrupt handler
ESP_RETURN_ON_ERROR(gpio_install_isr_service(0), TAG, "Error installing ISR service");
ESP_RETURN_ON_ERROR(gpio_isr_handler_add(SMB_ALERT_PIN, (gpio_isr_t) isr_handler, global_state), TAG, "Error adding ISR handler");
ESP_LOGI(TAG, "SMB Alert interrupt initialized on pin %d", SMB_ALERT_PIN);

View File

@ -10,6 +10,7 @@
#include "freertos/queue.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "esp_check.h"
#include "driver/gpio.h"
#include "esp_app_desc.h"
@ -106,20 +107,20 @@ void SYSTEM_init_system(GlobalState * GLOBAL_STATE)
memset(module->wifi_status, 0, 20);
}
void SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE) {
// Initialize the core voltage regulator
VCORE_init(GLOBAL_STATE, vreg_fault_isr);
VCORE_set_voltage(nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE) / 1000.0, GLOBAL_STATE);
esp_err_t SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE) {
ESP_RETURN_ON_ERROR(gpio_install_isr_service(0), TAG, "Error installing ISR service");
Thermal_init(GLOBAL_STATE->device_model, nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
// Initialize the core voltage regulator
ESP_RETURN_ON_ERROR(VCORE_init(GLOBAL_STATE, vreg_fault_isr), TAG, "VCORE init failed!");
ESP_RETURN_ON_ERROR(VCORE_set_voltage(nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE) / 1000.0, GLOBAL_STATE), TAG, "VCORE set voltage failed!");
ESP_RETURN_ON_ERROR(Thermal_init(GLOBAL_STATE->device_model, nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1)), TAG, "Thermal init failed!");
vTaskDelay(500 / portTICK_PERIOD_MS);
// Ensure overheat_mode config exists
esp_err_t ret = ensure_overheat_mode_config();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to ensure overheat_mode config");
}
ESP_RETURN_ON_ERROR(ensure_overheat_mode_config(), TAG, "Failed to ensure overheat_mode config");
//Init the DISPLAY
switch (GLOBAL_STATE->device_model) {
@ -138,15 +139,13 @@ void SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE) {
default:
}
if (input_init(screen_next, toggle_wifi_softap) != ESP_OK) {
ESP_LOGW(TAG, "Input init failed!");
}
ESP_RETURN_ON_ERROR(input_init(screen_next, toggle_wifi_softap), TAG, "Input init failed!");
if (screen_start(GLOBAL_STATE) != ESP_OK) {
ESP_LOGW(TAG, "Screen init failed");
}
ESP_RETURN_ON_ERROR(screen_start(GLOBAL_STATE), TAG, "Screen start failed!");
netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");
return ESP_OK;
}
void SYSTEM_notify_accepted_share(GlobalState * GLOBAL_STATE)

View File

@ -1,10 +1,11 @@
#ifndef SYSTEM_H_
#define SYSTEM_H_
#include "esp_err.h"
#include "global_state.h"
void SYSTEM_init_system(GlobalState * GLOBAL_STATE);
void SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE);
esp_err_t SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE);
void SYSTEM_notify_accepted_share(GlobalState * GLOBAL_STATE);
void SYSTEM_notify_rejected_share(GlobalState * GLOBAL_STATE);