Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 226f38bbba | |||
| f4861bb6cb | |||
| c29273f7e6 | |||
| f3391fe63b | |||
| 332e8a127f | |||
| ab83ab2ce0 | |||
| 498a3aceb6 | |||
| 41c6cb2964 | |||
| 33c3db2601 | |||
| 60c885a625 |
+1
-1
@@ -4,7 +4,7 @@
|
||||
#folder=$($path | awk -F"/" '{$NF}')
|
||||
folder=$(basename "$(pwd)")
|
||||
|
||||
if [ "$folder" == "bioprocc2650" ]; then
|
||||
if [ "$folder" == "ti" ]; then
|
||||
year=$(date +%-y)
|
||||
month=$(date +%-m)
|
||||
day=$(date +%-d)
|
||||
|
||||
BIN
Binary file not shown.
+98
-5
@@ -169,7 +169,7 @@ static void FlushNotify();
|
||||
#define EVT_NEU_REG_SPI 0x0008 /** register spi event */
|
||||
|
||||
/** clock setting */
|
||||
#define NEU_SYS_CLK 2000000 /**< 10Mhz */
|
||||
#define NEU_SYS_CLK 4000000 /**< 10Mhz */
|
||||
#define NEU_POLY_R_CLK 1000 /**< 1khz */
|
||||
#define NEU_SPI_FREQ NEU_SYS_CLK/10 /**< 1Mhz */ // should be NEU_SYS_CLK/10
|
||||
//#define NEU_LED_FREQ 1000000 /**< 1Mhz */
|
||||
@@ -299,6 +299,12 @@ typedef enum{
|
||||
#include "headstage_rec_ins.h"
|
||||
#include "headstage_sti_ins.h"
|
||||
|
||||
/* Debug function and parameter
|
||||
*
|
||||
*/
|
||||
static uint8_t data_rate_counter = 0;
|
||||
static uint32_t msg_counter = 0;
|
||||
static void SimpleBLEPeripheral_blastData();
|
||||
|
||||
/*
|
||||
* todo: need to define some procedure to detect this device status
|
||||
@@ -537,6 +543,7 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi
|
||||
}
|
||||
|
||||
case NEU_REC_PARAM: {
|
||||
headstage_led_color(COLOR_MAGENTA);
|
||||
uint8_t vgrp = instruction[0] & 0x1F;
|
||||
uint8_t vgrn = (instruction[1] & 0xF8) >> 3;
|
||||
uint8_t vgr_int_old = ((instruction[1] & 0x07) << 2) | ((instruction[2] & 0xC0) >> 6);
|
||||
@@ -567,8 +574,8 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi
|
||||
INSTRUCTION.vgr_intp = 16;
|
||||
INSTRUCTION.vgr_intn = 16;
|
||||
INSTRUCTION.vgr_int_old = 16;
|
||||
INSTRUCTION.recording_channel = 0b0000000001000010;
|
||||
INSTRUCTION.adc_clock_ratio = 50;
|
||||
INSTRUCTION.recording_channel = 0b0000000000000010;
|
||||
INSTRUCTION.adc_clock_ratio = 100; // sample rate = [NEU_SYS_CLK / (sys_clk_ratio = 10)] / adc_clock_ratio
|
||||
INSTRUCTION.sys_clk_ratio = 10;
|
||||
INSTRUCTION.sti_clock_ratio = 10;
|
||||
INSTRUCTION.amplifier_gain = 0;
|
||||
@@ -590,7 +597,7 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi
|
||||
INSTRUCTION.current_sti_cycle[0] = 100;
|
||||
INSTRUCTION.current_sti_cycle[1] = 100;
|
||||
INSTRUCTION.current_sti_cycle[8] = 10; // ch8 is volt ch
|
||||
INSTRUCTION.sti_channel = 0b0000000000000011; // 0bxxxx_xxxv_cccc_cccc, c = current; v = volt, x = don't care
|
||||
INSTRUCTION.sti_channel = 0b0000000000000000; // 0bxxxx_xxxv_cccc_cccc, c = current; v = volt, x = don't care
|
||||
INSTRUCTION.arbitrary_en = 0;
|
||||
INSTRUCTION.arbitrary_index = 0;
|
||||
INSTRUCTION.sti_mode = 0; // 1 = continuous mode; 0 = limit mode
|
||||
@@ -881,7 +888,6 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
|
||||
cdr_buf[6] = 0xCD;
|
||||
}
|
||||
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_SAMLL_SIZE, cdr_buf);
|
||||
break;
|
||||
}
|
||||
@@ -1088,6 +1094,16 @@ static void headstage_neu_state_spi() {
|
||||
|
||||
// recording
|
||||
else{
|
||||
// for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
|
||||
// spi_txbuf[i] = 0;
|
||||
// }
|
||||
//
|
||||
// if(data_rate_counter >= 63){
|
||||
// data_rate_counter = 0;
|
||||
// SimpleBLEPeripheral_blastData();
|
||||
// }
|
||||
// data_rate_counter ++;
|
||||
// headstage_spi_transaction(3);
|
||||
headstage_neu_append_notify_data();
|
||||
AppendSPITX(0, 0);
|
||||
headstage_spi_transaction(SPI_BUFFER_SIZE);
|
||||
@@ -1274,4 +1290,81 @@ static void headstage_neu_state_spi() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* @fn SimpleBLEPeripheral_blastData
|
||||
*
|
||||
* @brief Sends ATT notifications in a tight while loop to demo
|
||||
* throughput
|
||||
*
|
||||
* @param none
|
||||
*
|
||||
* @return none
|
||||
*/
|
||||
static void SimpleBLEPeripheral_blastData() {
|
||||
|
||||
uint32_t not_time_stamp = headstage_time_stamp_us();
|
||||
headstage_notify_buffer[0] = (msg_counter >> 24) & 0xFF;
|
||||
headstage_notify_buffer[1] = (msg_counter >> 16) & 0xFF;
|
||||
headstage_notify_buffer[2] = (msg_counter >> 8) & 0xFF;
|
||||
headstage_notify_buffer[3] = msg_counter & 0xFF;
|
||||
headstage_notify_buffer[4] = 0xFB;
|
||||
headstage_notify_buffer[5] = not_time_stamp & 0xFF;
|
||||
headstage_notify_buffer[6] = (not_time_stamp >> 8) & 0xFF;
|
||||
headstage_notify_buffer[7] = (not_time_stamp >> 16) & 0xFF;
|
||||
headstage_notify_buffer[8] = (not_time_stamp >> 24) & 0xFF;
|
||||
msg_counter++;
|
||||
SimpleProfile_SetParameter(BLE_NOT_BUFF_CHAR, BLE_NOT_BUFF_SIZE, headstage_notify_buffer);
|
||||
|
||||
// Subtract the total packet overhead of ATT and L2CAP layer from notification payload
|
||||
// uint16_t len = MAX_PDU_SIZE - TOTAL_PACKET_OVERHEAD;
|
||||
// attHandleValueNoti_t noti;
|
||||
// bStatus_t status;
|
||||
// noti.handle = 0x27;
|
||||
// noti.len = len;
|
||||
//
|
||||
// uint32_t not_time_stamp;
|
||||
//
|
||||
// // Store hte connection handle for future reference
|
||||
// uint16_t connectionHandle;
|
||||
// GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connectionHandle);
|
||||
//
|
||||
// not_time_stamp = Timestamp_get32() / 2;
|
||||
// noti.pValue = (uint8 *)GATT_bm_alloc(connectionHandle, ATT_HANDLE_VALUE_NOTI, GATT_MAX_MTU, &len);
|
||||
//
|
||||
// if (noti.pValue != NULL) // if allocated
|
||||
// {
|
||||
// // Place index
|
||||
// noti.pValue[2] = not_time_stamp & 0xFF;
|
||||
// noti.pValue[3] = (not_time_stamp >> 8) & 0xFF;
|
||||
// noti.pValue[4] = (not_time_stamp >> 16) & 0xFF;
|
||||
// noti.pValue[5] = (not_time_stamp >> 24) & 0xFF;
|
||||
// noti.pValue[6] = 100;
|
||||
// noti.pValue[7] = 0;
|
||||
//
|
||||
// // Attempt to send the notification
|
||||
// status = GATT_Notification(connectionHandle, ¬i, GATT_NO_AUTHENTICATION);
|
||||
// if (status != SUCCESS) // if noti not sent
|
||||
// {
|
||||
//// PIN_setOutputValue(hSbpPins, Board_LED1, Board_LED_ON);
|
||||
// headstage_led_color(COLOR_RED);
|
||||
// headstage_led_color(COLOR_BLACK);
|
||||
// GATT_bm_free((gattMsg_t *)¬i, ATT_HANDLE_VALUE_NOTI);
|
||||
// } else {
|
||||
// // Notification is successfully sent, increment counters
|
||||
//// Display_print0(dispHandle, 4, 0, "success");
|
||||
//// PIN_setOutputValue(hSbpPins, Board_LED2, Board_LED_ON);
|
||||
// headstage_led_color(COLOR_BLUE);
|
||||
// headstage_led_color(COLOR_BLACK);
|
||||
// msg_counter++;
|
||||
// }
|
||||
// } else {
|
||||
// // bleNoResources was returned
|
||||
// asm(" NOP ");
|
||||
// }
|
||||
|
||||
// Reset debug pins
|
||||
// PIN_setOutputValue(hSbpPins, Board_LED1, Board_LED_OFF);
|
||||
// PIN_setOutputValue(hSbpPins, Board_LED2, Board_LED_OFF);
|
||||
}
|
||||
#endif
|
||||
|
||||
+5
-5
@@ -3,15 +3,15 @@
|
||||
#define VERSION_DATE
|
||||
|
||||
#define VERSION_DATE_YEAR 20
|
||||
#define VERSION_DATE_MONTH 7
|
||||
#define VERSION_DATE_DAY 9
|
||||
#define VERSION_DATE_MONTH 8
|
||||
#define VERSION_DATE_DAY 3
|
||||
#define VERSION_DATE_HOUR 17
|
||||
#define VERSION_DATE_MINUTE 7
|
||||
#define VERSION_DATE_MINUTE 42
|
||||
|
||||
// this is NOT the version hash !!
|
||||
// it's the last version hash
|
||||
#define VERSION_HASH b19b8189278e6ef6b9d9db3b7bc8f6f9df565f05
|
||||
#define VERSION_GIT_BRANCH Neulive2.0_developement
|
||||
#define VERSION_HASH f4861bb6cb427dcb36cb0cb6e8f1c962dbd89fa8
|
||||
#define VERSION_GIT_BRANCH neulive20_linux_debug
|
||||
|
||||
static void get_board_name(char *board_name_ch, uint8 *board_name_int, uint8 name_size){
|
||||
uint8 name_offset = 18;
|
||||
|
||||
+8
-1
@@ -13,6 +13,7 @@
|
||||
static uint8_t not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
static uint32_t not_time_stamp = 0;
|
||||
|
||||
static uint32_t debug_counter = 0;
|
||||
static void headstage_notify_set_timestamp() {
|
||||
not_time_stamp = headstage_time_stamp_us();
|
||||
|
||||
@@ -20,12 +21,18 @@ static void headstage_notify_set_timestamp() {
|
||||
headstage_notify_buffer[3] = (not_time_stamp >> 8) & 0xFF;
|
||||
headstage_notify_buffer[4] = (not_time_stamp >> 16) & 0xFF;
|
||||
headstage_notify_buffer[5] = (not_time_stamp >> 24) & 0xFF;
|
||||
|
||||
// headstage_notify_buffer[2] = (debug_counter >> 24) & 0xFF;
|
||||
// headstage_notify_buffer[3] = (debug_counter >> 16) & 0xFF;
|
||||
// headstage_notify_buffer[4] = (debug_counter >> 8) & 0xFF;
|
||||
// headstage_notify_buffer[5] = debug_counter & 0xFF;
|
||||
// debug_counter ++;
|
||||
}
|
||||
|
||||
static void headstage_notify_flip_buffer() {
|
||||
uint8_t data_count = (not_buf_offset - NOT_BUF_OFFSET_INIT) / 3;
|
||||
|
||||
headstage_notify_buffer[0] = CHIP_ID;
|
||||
headstage_notify_buffer[0] = 4;
|
||||
headstage_notify_buffer[1] = data_count;
|
||||
|
||||
not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
|
||||
+3
-3
@@ -120,17 +120,17 @@
|
||||
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
|
||||
// parameter update request is enabled
|
||||
//#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 6
|
||||
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 30
|
||||
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 40
|
||||
|
||||
#else //! FEATURE_OAD
|
||||
// Minimum connection interval (units of 1.25ms, 8=10ms) if automatic
|
||||
// parameter update request is enabled
|
||||
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 80
|
||||
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8
|
||||
//#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 14
|
||||
|
||||
// Maximum connection interval (units of 1.25ms, 8=10ms) if automatic
|
||||
// parameter update request is enabled
|
||||
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 80
|
||||
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 40
|
||||
//#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 25
|
||||
|
||||
#endif // FEATURE_OAD
|
||||
|
||||
Reference in New Issue
Block a user