diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_neu.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_neu.h index bf56883d3..86c3818c2 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_neu.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_neu.h @@ -304,29 +304,6 @@ static uint8_t headstage_debug_instruction(uint8_t* ins_buf) { return 0; } -/** - * @fn build amplifier bias - */ - -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; - INSTRUCTION.ins_opcode = BIAS_TWO; - return false; - } - case BIAS_TWO: { - *value = (0x01 << 23) | (0x3A << 16) | NEU_LNA_BIAS_TWO; - INSTRUCTION.ins_opcode = BIAS_TWO; - return true; - } - default: { - return false; - } - } -} - /** * @fn headstage_init * @@ -1017,7 +994,7 @@ static void headstage_neu_state_spi() { SPICallBack = ONE_SHOT_SPI; INSTRUCTION.ins_opcode = T_ZE; - nxt_ins = build_ins_ins(NEULIVE_STATE.config_type, &value); /**< set instruction one by one in order to set all the parameter.*/ + nxt_ins = build_sti_ins(NEULIVE_STATE.config_type, &value); /**< set instruction one by one in order to set all the parameter.*/ NEULIVE_STATE.config_type = nxt_ins; if (nxt_ins == NEU_SETUP_DONE) { @@ -1135,7 +1112,7 @@ static void headstage_neu_state_spi() { // terminate stimulation - case NEU_STI_INT { + case NEU_STI_INT: { NEULIVE_STATE.state = NEU_STI_INT_TWICE; SPICallBack = ONE_SHOT_SPI; @@ -1145,7 +1122,7 @@ static void headstage_neu_state_spi() { break; } - case NEU_STI_INT_TWICE { + case NEU_STI_INT_TWICE: { NEULIVE_STATE.state = NEU_CHECK_STI_INT; SPICallBack = ONE_SHOT_SPI; @@ -1155,7 +1132,7 @@ static void headstage_neu_state_spi() { break; } - case NEU_CHECK_STI_INT { + case NEU_CHECK_STI_INT: { rec_sti_command &= ~STATUS_STI; if(rec_sti_command & STATUS_REC){ check_register(STI_CHANNEL_REG, 0, NEU_PREPARE_READ); diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_rec_ins.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_rec_ins.h index cd298cfa3..bd68ae380 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_rec_ins.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_rec_ins.h @@ -4,6 +4,29 @@ #include "headstage_instruction.h" +/** + * @fn build amplifier bias + */ + +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; + INSTRUCTION.ins_opcode = BIAS_TWO; + return false; + } + case BIAS_TWO: { + *value = (0x01 << 23) | (0x3A << 16) | NEU_LNA_BIAS_TWO; + INSTRUCTION.ins_opcode = BIAS_TWO; + return true; + } + default: { + return false; + } + } +} + static uint8_t build_rec_ins(uint8_t config_type, uint32_t* value) { bool single_ch_config_done; bool done; diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti_ins.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti_ins.h index a1fb2a0f9..0400f13dc 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti_ins.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_sti_ins.h @@ -198,6 +198,10 @@ static uint8_t build_sti_ins(uint8_t config_type, uint32_t* value){ *value = (0x01 << 23) | (0x38 << 16) | (INSTRUCTION.sti_mode << 2) | (INSTRUCTION.sti_h_bridge << 1) | (INSTRUCTION.sti_ref); return NEU_SETUP_DONE; } + + default: { + return NEU_WARM_UP; + } } } #endif