Skip to content
Snippets Groups Projects
Commit e2c88814 authored by Christos Gentsos's avatar Christos Gentsos
Browse files

Main: add an extended command to get the uptime in seconds

parent 75273770
Branches
Tags
No related merge requests found
......@@ -61,6 +61,8 @@ extern uint16_t powrs_lin[MAX_PAGE+1];
extern uint16_t temps_lin[3];
extern uint16_t frpms_lin[3];
extern uint32_t seconds_up;
uint32_t TMR_ERROR_CNT;
static uint8_t dummy_byte;
......@@ -123,6 +125,7 @@ static int8_t cmd_data_length_query = -1;
static const int8_t ext_cmd_data_lengths[] = {
1, // 0x05
1, // 0x06
4, // 0x10
4, // 0xA0
1, // 0xB0
13, // 0xC0
......@@ -156,11 +159,12 @@ static const cmd_t cmds_cmds[] = (cmd_t[]){
{0x003E, (int8_t *)&cmd_data_lengths[23], (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},
{0xFFA0, (int8_t *)&ext_cmd_data_lengths[2], (uint8_t *)&TMR_ERROR_CNT, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, 0, 0},
{0xFFB0, (int8_t *)&ext_cmd_data_lengths[3], (uint8_t *)&use_pec_tmp, (fp_t)NULL, &set_pec, (fp_t)NULL, 0, 1},
{0xFFC0, (int8_t *)&ext_cmd_data_lengths[4], (uint8_t *)&temp_curve_points_data, (fp_t)NULL, &set_tc_curve, (fp_t)NULL, 0, 0},
{0xFFC1, (int8_t *)&ext_cmd_data_lengths[5], (uint8_t *)&temp_matrix_row, (fp_t)NULL, &set_tc_matrix, (fp_t)NULL, 0, 0},
{0xFFC4, (int8_t *)&ext_cmd_data_lengths[6], (uint8_t *)&tc_on, (fp_t)NULL, &set_tc_onoff, (fp_t)NULL, 0, 0}};
{0xFF10, (int8_t *)&ext_cmd_data_lengths[2], (uint8_t *)&seconds_up, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, 0, 0},
{0xFFA0, (int8_t *)&ext_cmd_data_lengths[3], (uint8_t *)&TMR_ERROR_CNT, (fp_t)NULL, (fp_t)NULL, (fp_t)NULL, 0, 0},
{0xFFB0, (int8_t *)&ext_cmd_data_lengths[4], (uint8_t *)&use_pec_tmp, (fp_t)NULL, &set_pec, (fp_t)NULL, 0, 1},
{0xFFC0, (int8_t *)&ext_cmd_data_lengths[5], (uint8_t *)&temp_curve_points_data, (fp_t)NULL, &set_tc_curve, (fp_t)NULL, 0, 0},
{0xFFC1, (int8_t *)&ext_cmd_data_lengths[6], (uint8_t *)&temp_matrix_row, (fp_t)NULL, &set_tc_matrix, (fp_t)NULL, 0, 0},
{0xFFC4, (int8_t *)&ext_cmd_data_lengths[7], (uint8_t *)&tc_on, (fp_t)NULL, &set_tc_onoff, (fp_t)NULL, 0, 0}};
cmd_space_t cmds = {
sizeof(cmds_cmds)/sizeof(cmd_t),
......
......@@ -29,6 +29,8 @@ uint16_t powrs_lin[MAX_PAGE+1];
uint16_t temps_lin[3];
uint16_t frpms_lin[3];
volatile uint32_t seconds_up __xMR;
#define TOTAL_PWM_CLOCKS 255
int16_t curr_pwm_duty1000_1 = 10;
......@@ -365,6 +367,7 @@ static void __xMR mytimercallback(const struct timer_task *const timer_task)
update_pwm();
#endif
if (iter == 99) {
++seconds_up;
iter = 0;
#if defined(MMFANT) || defined(MMPROT)
update_rpm();
......
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