This commit is contained in:
Benjamin Wilson 2025-01-21 23:01:28 -05:00
parent 2f38e202a9
commit ef208ad224
5 changed files with 33 additions and 21 deletions

View File

@ -1,6 +1,6 @@
{
"idf.flashType": "UART",
"idf.portWin": "COM72",
"idf.portWin": "COM3",
"idf.adapterTargetName": "esp32s3",
"idf.openOcdConfigs": [
"board/esp32s3-builtin.cfg"
@ -55,7 +55,12 @@
"cmath": "c",
"utils.h": "c",
"task.h": "c",
"stdlib.h": "c"
"stdlib.h": "c",
"xmemory": "c",
"xstring": "c",
"xtr1common": "c",
"xutility": "c",
"xlocale": "c"
},
"editor.formatOnSave": false,
"cSpell.words": [

View File

@ -556,6 +556,9 @@ void TPS546_write_entire_config(void)
ESP_LOGI(TAG, "Writing MFR REVISION");
smb_write_block(PMBUS_MFR_ID, MFR_REVISION, 3);
smb_write_word(PMBUS_STACK_CONFIG, INIT_STACK_CONFIG_TWO_PHASE);
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Never write this to NVM as it can corrupt the TPS in an unrecoverable state, just do it on boot every time

View File

@ -54,7 +54,11 @@
#define TPS546_INIT_TOFF_DELAY 0
#define TPS546_INIT_TOFF_FALL 0
#define INIT_STACK_CONFIG 0x0000
#define INIT_STACK_CONFIG_ONE_PHASE 0x0000
#define INIT_STACK_CONFIG_TWO_PHASE 0x0001
#define INIT_STACK_CONFIG_THREE_PHASE 0x0002
#define INIT_STACK_CONFIG_FOUR_PHASE 0x0003
#define INIT_SYNC_CONFIG 0x0010
#define INIT_PIN_DETECT_OVERRIDE 0x0000

View File

@ -59,10 +59,10 @@ void app_main(void)
// Optionally hold the boot button
bool pressed = gpio_get_level(CONFIG_GPIO_BUTTON_BOOT) == 0; // LOW when pressed
//should we run the self test?
if (should_test(&GLOBAL_STATE) || pressed) {
self_test((void *) &GLOBAL_STATE);
return;
}
// if (should_test(&GLOBAL_STATE) || pressed) {
// self_test((void *) &GLOBAL_STATE);
// return;
// }
SYSTEM_init_system(&GLOBAL_STATE);
@ -82,7 +82,7 @@ void app_main(void)
SYSTEM_init_peripherals(&GLOBAL_STATE);
xTaskCreate(POWER_MANAGEMENT_task, "power management", 8192, (void *) &GLOBAL_STATE, 10, NULL);
//xTaskCreate(POWER_MANAGEMENT_task, "power management", 8192, (void *) &GLOBAL_STATE, 10, NULL);
//start the API for AxeOS
start_rest_server((void *) &GLOBAL_STATE);

View File

@ -91,19 +91,19 @@ void SYSTEM_init_peripherals(GlobalState * GLOBAL_STATE) {
VCORE_set_voltage(nvs_config_get_u16(NVS_CONFIG_ASIC_VOLTAGE, CONFIG_ASIC_VOLTAGE) / 1000.0, GLOBAL_STATE);
//init the EMC2101, if we have one
switch (GLOBAL_STATE->device_model) {
case DEVICE_MAX:
case DEVICE_ULTRA:
case DEVICE_SUPRA:
EMC2101_init(nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
break;
case DEVICE_GAMMA:
EMC2101_init(nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
EMC2101_set_ideality_factor(EMC2101_IDEALITY_1_0319);
EMC2101_set_beta_compensation(EMC2101_BETA_11);
break;
default:
}
// switch (GLOBAL_STATE->device_model) {
// case DEVICE_MAX:
// case DEVICE_ULTRA:
// case DEVICE_SUPRA:
// EMC2101_init(nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
// break;
// case DEVICE_GAMMA:
// EMC2101_init(nvs_config_get_u16(NVS_CONFIG_INVERT_FAN_POLARITY, 1));
// EMC2101_set_ideality_factor(EMC2101_IDEALITY_1_0319);
// EMC2101_set_beta_compensation(EMC2101_BETA_11);
// break;
// default:
// }
//initialize the INA260, if we have one.
switch (GLOBAL_STATE->device_model) {