From 2a6cd4974847768aaa9c0d21f3cae98c4d5ea45a Mon Sep 17 00:00:00 2001 From: yichin Date: Thu, 9 Jul 2020 17:06:01 +0800 Subject: [PATCH] sti ins send t1~t5 only one time (every ch use same pattern) --- .../cc26xx/app/headstage/headstage_neu.h | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) 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 948e0fdc7..91ebe4be7 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 @@ -515,20 +515,24 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi case NEU_MULTI_STI: { uint8_t ch = instruction[1]; - uint8_t sti_cycles = instruction[2]; - INSTRUCTION.sti_t1[ch] = (instruction[3] << 8) | instruction[4]; - INSTRUCTION.sti_t2[ch] = (instruction[5] << 8) | instruction[6]; - INSTRUCTION.sti_t3[ch] = (instruction[7] << 8) | instruction[8]; - INSTRUCTION.sti_t4[ch] = (0x00 << 24) | (instruction[9] << 16) | (instruction[10] << 8) | instruction[11]; - INSTRUCTION.sti_t5[ch] = (instruction[12] << 8) | instruction[13]; - INSTRUCTION.current_sti_cycle[ch] = sti_cycles; +// uint8_t sti_cycles = instruction[2]; +// INSTRUCTION.sti_t1[ch] = (instruction[3] << 8) | instruction[4]; +// INSTRUCTION.sti_t2[ch] = (instruction[5] << 8) | instruction[6]; +// INSTRUCTION.sti_t3[ch] = (instruction[7] << 8) | instruction[8]; +// INSTRUCTION.sti_t4[ch] = (0x00 << 24) | (instruction[9] << 16) | (instruction[10] << 8) | instruction[11]; +// INSTRUCTION.sti_t5[ch] = (instruction[12] << 8) | instruction[13]; +// INSTRUCTION.current_sti_cycle[ch] = sti_cycles; + + for(int i=0 ; i<8 ; i++){ + uint8_t sti_cycles = instruction[2]; + INSTRUCTION.sti_t1[i] = (instruction[3] << 8) | instruction[4]; + INSTRUCTION.sti_t2[i] = (instruction[5] << 8) | instruction[6]; + INSTRUCTION.sti_t3[i] = (instruction[7] << 8) | instruction[8]; + INSTRUCTION.sti_t4[i] = (0x00 << 24) | (instruction[9] << 16) | (instruction[10] << 8) | instruction[11]; + INSTRUCTION.sti_t5[i] = (instruction[12] << 8) | instruction[13]; + INSTRUCTION.current_sti_cycle[i] = sti_cycles; + } -// INSTRUCTION.sti_t1[n_ch] = (instruction[3] << 8) | instruction[4]; -// INSTRUCTION.sti_t2[n_ch] = (instruction[5] << 8) | instruction[6]; -// INSTRUCTION.sti_t3[n_ch] = (instruction[7] << 8) | instruction[8]; -// INSTRUCTION.sti_t4[n_ch] = (0x00 << 24) | (instruction[9] << 16) | (instruction[10] << 8) | instruction[11]; -// INSTRUCTION.sti_t5[n_ch] = (instruction[12] << 8) | instruction[13]; -// INSTRUCTION.current_sti_cycle[n_ch] = sti_cycles; break; }