Commit b8df1aa9 authored by Christos Gentsos's avatar Christos Gentsos

Main: make FAN_CONFIG_x_y commands also readable (return the config)

They were
parent 064b5e49
Pipeline #2956 failed with stage
in 0 seconds
......@@ -92,6 +92,7 @@ extern uint16_t temp_control_on __xMR;
uint8_t fan_config_1_2;
uint8_t fan_config_3_4;
void fan_config();
void get_fan_configs();
extern uint16_t fan_installed[3] __xMR;
extern uint16_t fan_cmdrpm[3] __xMR;
extern uint16_t fan_ppr[3] __xMR;
......@@ -160,10 +161,10 @@ static const cmd_t cmds_cmds[] = (cmd_t[]){
{0x009C, (int8_t *)&cmd_data_lengths[17], (uint8_t *)&MFR_LOC, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, QUERY_RD | QUERY_FMT_NAN, 0},
{0x009D, (int8_t *)&cmd_data_lengths[18], (uint8_t *)&MFR_DAT, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, QUERY_RD | QUERY_FMT_NAN, 0},
{0x009E, (int8_t *)&cmd_data_lengths[19], (uint8_t *)&MFR_SER, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, QUERY_RD | QUERY_FMT_NAN, 0},
{0x003A, (int8_t *)&cmd_data_lengths[20], (uint8_t *)&fan_config_1_2, (fp_t)NULL, &fan_config, (fp_t)NULL, QUERY_WR | QUERY_FMT_NAN, 0},
{0x003A, (int8_t *)&cmd_data_lengths[20], (uint8_t *)&fan_config_1_2, &get_fan_configs, &fan_config, (fp_t)NULL, QUERY_WR | QUERY_FMT_NAN, 0},
{0x003B, (int8_t *)&cmd_data_lengths[21], (uint8_t *)&setfrpms_lin[0], (fp_t)NULL, &set_frpms, (fp_t)NULL, QUERY_WR | QUERY_FMT_LIN, 0},
{0x003C, (int8_t *)&cmd_data_lengths[22], (uint8_t *)&setfrpms_lin[1], (fp_t)NULL, &set_frpms, (fp_t)NULL, QUERY_WR | QUERY_FMT_LIN, 0},
{0x003D, (int8_t *)&cmd_data_lengths[23], (uint8_t *)&fan_config_3_4, (fp_t)NULL, &fan_config, (fp_t)NULL, QUERY_WR | QUERY_FMT_NAN, 0},
{0x003D, (int8_t *)&cmd_data_lengths[23], (uint8_t *)&fan_config_3_4, &get_fan_configs, &fan_config, (fp_t)NULL, QUERY_WR | QUERY_FMT_NAN, 0},
{0x003E, (int8_t *)&cmd_data_lengths[24], (uint8_t *)&setfrpms_lin[2], (fp_t)NULL, &set_frpms, (fp_t)NULL, QUERY_WR | QUERY_FMT_LIN, 0},
{0xFF05, (int8_t *)&ext_cmd_data_lengths[0], (uint8_t *)&dummy_byte, (fp_t)NULL, &boot_new_fw, (fp_t)NULL, 0, 0},
{0xFF06, (int8_t *)&ext_cmd_data_lengths[1], (uint8_t *)&dummy_byte, (fp_t)NULL, &uc_reset, (fp_t)NULL, 0, 0},
......@@ -298,6 +299,13 @@ void __xMR fan_config()
flash_write_row((uint32_t *)&user_flash, (uint32_t *)fw_write_buf);
}
void __xMR get_fan_configs()
{
fan_config_1_2 = (fan_installed[0] << 7) | (fan_cmdrpm[0] << 6) | (fan_ppr[0] << 4) |
(fan_installed[1] << 3) | (fan_cmdrpm[1] << 2) | (fan_ppr[1]);
fan_config_3_4 = (fan_installed[2] << 7) | (fan_cmdrpm[2] << 6) | (fan_ppr[2] << 4);
}
void __xMR set_frpms()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment