Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd566be7b5 | |||
| aec34a874f | |||
| 707ec44894 | |||
| 77e34ea969 | |||
| f4dbf99294 |
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11
-4
@@ -773,11 +773,13 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
|
||||
case VIS_RST:
|
||||
headstage_reset();
|
||||
headstage_state = UMC_STATE_HANDSHAKE;
|
||||
INSTRUCTION.channel_pointer=0;
|
||||
// try to pull PIN_RESET PIN to ground
|
||||
break;
|
||||
case VIS_STI:
|
||||
if (headstage_state == UMC_STATE_INTERRUPT) {
|
||||
if (headstage_state == UMC_STATE_INTERRUPT) { //This if cond. seems only for old version digital core
|
||||
headstage_state = UMC_STATE_INITIAL;
|
||||
INSTRUCTION.channel_pointer=0;
|
||||
rearrange_channel_mux_table();
|
||||
UMC_STATE.config_type = CONFIG_AMP_MUX;
|
||||
headstage_led_spi_color(COLOR_BLACK);
|
||||
@@ -785,6 +787,7 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
|
||||
headstage_spi_ask_transaction(4);
|
||||
} else {
|
||||
headstage_state = UMC_STATE_HANDSHAKE;
|
||||
INSTRUCTION.channel_pointer=0;
|
||||
rearrange_channel_mux_table();
|
||||
headstage_pwm_start(headstage_system_pwm_handle);
|
||||
headstage_pwm_start(headstage_poly_r_pwm_handle);
|
||||
@@ -800,6 +803,7 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
|
||||
case VIS_INT:
|
||||
headstage_reset();
|
||||
headstage_state = UMC_STATE_HANDSHAKE;
|
||||
INSTRUCTION.channel_pointer=0;
|
||||
break;
|
||||
|
||||
case VIS_BLE_T:
|
||||
@@ -890,13 +894,15 @@ static void headstage_uni_umc_data_append_notify_buffer(uint8_t* dat_buf) {
|
||||
}
|
||||
|
||||
uint8_t channel;
|
||||
uint8_t channel_pointer = INSTRUCTION.channel_pointer;
|
||||
|
||||
if ((INSTRUCTION.enable_channel_number == 1) || (dat_buf[0] == 0xc1)) {
|
||||
if ((INSTRUCTION.enable_channel_number == 1)) {
|
||||
channel = reverse_channel[INSTRUCTION.last_enable_channel];
|
||||
} else {
|
||||
uint8_t channel_pointer = (INSTRUCTION.channel_pointer + 1) % INSTRUCTION.last_enable_channel;
|
||||
//uint8_t channel_pointer = (INSTRUCTION.channel_pointer + 1) % INSTRUCTION.last_enable_channel;
|
||||
channel = reverse_channel[INSTRUCTION.channel_mux[channel_pointer]];
|
||||
INSTRUCTION.channel_pointer = channel_pointer;
|
||||
channel_pointer++;
|
||||
INSTRUCTION.channel_pointer = channel_pointer % (INSTRUCTION.last_enable_channel+1);
|
||||
}
|
||||
uint8_t data_size = headstage_notify_append_data(channel, dat_buf);
|
||||
if (data_size >= BLE_NOT_BUFF_SIZE) {
|
||||
@@ -920,6 +926,7 @@ static uint8_t build_umn_ins_config(uint8_t config_type, uint32_t* value) {
|
||||
if (channel_pointer < INSTRUCTION.enable_channel_number) {
|
||||
return CONFIG_AMP_MUX;
|
||||
} else {
|
||||
INSTRUCTION.channel_pointer = 0;
|
||||
return CONFIG_AMP_GAIN;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -408,8 +408,7 @@ static void SimpleBLEPeripheral_init(void) {
|
||||
GATT_RegisterForMsgs(self);
|
||||
|
||||
headstage_led_spi_color(COLOR_GREEN);
|
||||
HCI_LE_ReadMaxDataLenCmd();
|
||||
|
||||
// HCI_LE_ReadMaxDataLenCmd(); //YiChin said this command is not necessary
|
||||
HCI_LE_WriteSuggestedDefaultDataLenCmd(251, 2120); // this is used for data length extension
|
||||
|
||||
|
||||
@@ -847,6 +846,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
|
||||
case GAPROLE_WAITING:
|
||||
// Device is started but not advertising, is in waiting period before advertising again
|
||||
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
|
||||
headstage_led_spi_color(COLOR_GREEN);
|
||||
break;
|
||||
|
||||
case GAPROLE_WAITING_AFTER_TIMEOUT:
|
||||
@@ -862,6 +862,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
|
||||
break;
|
||||
case GAPROLE_INIT: // Waiting to be started
|
||||
case GAPROLE_ADVERTISING: // Currently Advertising
|
||||
headstage_led_spi_color(COLOR_GREEN);
|
||||
case GAPROLE_CONNECTED_ADV: // In a connection and advertising
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user