begin to debug

This commit is contained in:
yichin
2019-09-10 10:05:30 +08:00
parent 09685951c3
commit 7cc337c0fd
@@ -70,11 +70,11 @@
*/
#define DEVICE_NAME "Neulive-v2.0"
#define MAJOR_PRODUCT_NUMBER 1
#define MINOR_PRODUCT_NUMBER 1
#define MAJOR_VERSION_NUMBER 2
#define MINOR_VERSION_NUMBER 0
#define DEVICE_NAME "Neulive-v2.0"
#define MAJOR_PRODUCT_NUMBER 1
#define MINOR_PRODUCT_NUMBER 1
#define MAJOR_VERSION_NUMBER 2
#define MINOR_VERSION_NUMBER 0
/*===================================
==== instruction building macro ====
@@ -342,8 +342,8 @@ static bool build_sti_cur_instruction(uint8_t sti_channel, uint32_t* value) {
return false;
}
case STI_CYCLE: {
op_neu = (sti_channel / 2) + 42;
uint8_t odd_even = sti_channel % 2;
op_neu = (sti_channel / 2) + 42;
uint8_t odd_even = sti_channel % 2;
INSTRUCTION.ins_opcode = HIGH_SIDE;
if (odd_even)
*value = (0x01 << 23) | (op_neu << 16) | (INSTRUCTION.current_sti_cycle[sti_channel] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel - 1]);
@@ -351,7 +351,7 @@ static bool build_sti_cur_instruction(uint8_t sti_channel, uint32_t* value) {
*value = (0x01 << 23) | (op_neu << 16) | (INSTRUCTION.current_sti_cycle[sti_channel + 1] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel]);
return true;
}
default:{
default: {
return false;
}
}
@@ -391,7 +391,7 @@ static bool build_sti_volt(uint32_t* value) {
return false;
}
case VOLT_MODE_AMP: {
*value = (0x01 << 23) | (0x27 << 16) | INSTRUCTION.voltage_sti_amplitude;
*value = (0x01 << 23) | (0x27 << 16) | INSTRUCTION.voltage_sti_amplitude;
INSTRUCTION.ins_opcode = BIAS_ONE;
return true;
}
@@ -404,12 +404,12 @@ static bool build_amp_bias(uint32_t* value) {
uint8_t ins_opcode = INSTRUCTION.ins_opcode;
switch (ins_opcode) {
case BIAS_ONE: {
*value = (0x01 << 23) | (0x39 << 16) | NEU_LNA_BIAS_ONE;
*value = (0x01 << 23) | (0x39 << 16) | NEU_LNA_BIAS_ONE;
INSTRUCTION.ins_opcode = BIAS_TWO;
return false;
}
case BIAS_TWO: {
*value = (0x01 << 23) | (0x3A << 16) | NEU_LNA_BIAS_TWO;
*value = (0x01 << 23) | (0x3A << 16) | NEU_LNA_BIAS_TWO;
INSTRUCTION.ins_opcode = BIAS_TWO;
return true;
}
@@ -576,7 +576,7 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
break; /** reset all the parameter */
case VIS_STI: {
flag_notify(EVT_NEU_SPI);
NEULIVE_STATE.state = NEU_WRITE_INSTRUCTION;
NEULIVE_STATE.state = NEU_WRITE_INSTRUCTION;
INSTRUCTION.ins_opcode = T_FT;
break; /** start to operate */
}
@@ -621,11 +621,11 @@ static uint8_t build_neu_ins_config(uint8_t config_type, uint32_t* value) {
done = build_sti_cur_instruction(sti_channel, value);
if (done) {
if (sti_channel == 0xff) {
headstage_led_color(COLOR_RED);
return NEU_SET_STI_VOLT;
}
else
} else {
headstage_led_color(COLOR_RED);
return NEU_SET_STI_CUR;
}
} else {
return NEU_SET_STI_CUR;
}
@@ -715,8 +715,7 @@ static void headstage_neu_state_spi() {
headstage_spi_transaction(3);
if (nxt_ins == NEU_SETUP_DONE) {
NEULIVE_STATE.state = NEU_READ_DATA;
}
else
} else
NEULIVE_STATE.state = NEU_WRITE_INSTRUCTION;
break;
}