Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 916476c468 | |||
| c347e44536 | |||
| af836b02e4 | |||
| 1c53cc09ec | |||
| 99f4ef2a5b | |||
| 81536688aa |
+4
-5
@@ -27,14 +27,14 @@ static void SendCaliValue(uint8_t CaliNumber){
|
||||
|
||||
// ch = 2 * (CaliNumber % 4);
|
||||
// uint8_t gain_level = CaliNumber / 4; // 0:gain, 1:offset
|
||||
uint8_t channel_number = 8, index = 1;
|
||||
uint8_t channel_number = 8, index = 2;
|
||||
uint8_t gain_level = 0;
|
||||
|
||||
if(CaliNumber < 4){
|
||||
gain_level = CaliNumber;
|
||||
}
|
||||
|
||||
cali_buf[0] = CHIP_ID;
|
||||
cali_buf[1] = CHIP_ID;
|
||||
for(int i=0 ; i<channel_number ; i++){
|
||||
cali_buf[index++] = (uint8_t) (CaliTable.Ch[i].Gain[gain_level] >> 8) & 0xFF;
|
||||
cali_buf[index++] = (uint8_t) CaliTable.Ch[i].Gain[gain_level] & 0x00FF;
|
||||
@@ -42,9 +42,8 @@ static void SendCaliValue(uint8_t CaliNumber){
|
||||
cali_buf[index++] = (uint8_t) CaliTable.Ch[i].Offset[gain_level] & 0x00FF;
|
||||
}
|
||||
|
||||
// for(int i=1 ; i<BLE_CDR_BUFF_SIZE ; i++){
|
||||
// cali_buf[i] = i;
|
||||
// }
|
||||
cali_buf[0] = index;
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, index, cali_buf);
|
||||
}
|
||||
|
||||
|
||||
+30
-12
@@ -820,6 +820,10 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
|
||||
switch (cis_oper) {
|
||||
case CIS_NOP: {
|
||||
// nothing
|
||||
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++ ){
|
||||
cdr_buf[i] = 0;
|
||||
}
|
||||
|
||||
cdr_buf[0] = _B_4b4b(CIS_NOP, CHIP_ID);
|
||||
cdr_buf[1] = _B_4b4b(CDR_SUCCESS, 0);
|
||||
|
||||
@@ -828,9 +832,14 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
|
||||
}
|
||||
//#ifdef HEADSTAGE_CIS_VOLT_H
|
||||
case CIS_VOLT: {
|
||||
cdr_buf[0] = CIS_VOLT | CHIP_ID;
|
||||
cdr_buf[1] = headstage_battery_volt1();
|
||||
cdr_buf[2] = headstage_battery_volt2();
|
||||
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++ ){
|
||||
cdr_buf[i] = 0;
|
||||
}
|
||||
|
||||
cdr_buf[0] = BLE_CDR_SAMLL_SIZE; // data length
|
||||
cdr_buf[1] = CIS_VOLT | CHIP_ID;
|
||||
cdr_buf[2] = headstage_battery_volt1();
|
||||
cdr_buf[3] = headstage_battery_volt2();
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_SAMLL_SIZE, cdr_buf);
|
||||
|
||||
@@ -862,23 +871,28 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
|
||||
//#endif
|
||||
|
||||
case CIS_VERSION:{
|
||||
cdr_buf[0] = VERSION_DATE_YEAR;
|
||||
cdr_buf[1] = VERSION_DATE_MONTH;
|
||||
cdr_buf[2] = VERSION_DATE_DAY;
|
||||
cdr_buf[3] = VERSION_DATE_HOUR;
|
||||
cdr_buf[4] = VERSION_DATE_MINUTE;
|
||||
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++ ){
|
||||
cdr_buf[i] = 0;
|
||||
}
|
||||
|
||||
cdr_buf[0] = BLE_CDR_SAMLL_SIZE;
|
||||
cdr_buf[1] = VERSION_DATE_YEAR;
|
||||
cdr_buf[2] = VERSION_DATE_MONTH;
|
||||
cdr_buf[3] = VERSION_DATE_DAY;
|
||||
cdr_buf[4] = VERSION_DATE_HOUR;
|
||||
cdr_buf[5] = VERSION_DATE_MINUTE;
|
||||
|
||||
uint8_t mac_int[4];
|
||||
if( strncmp(CaliTable.DeviceName, "BOARD_TEST", 25)){
|
||||
// has a specific cali data
|
||||
get_board_name(CaliTable.DeviceName, mac_int, 4);
|
||||
cdr_buf[5] = mac_int[0];
|
||||
cdr_buf[6] = mac_int[1];
|
||||
cdr_buf[6] = mac_int[0];
|
||||
cdr_buf[7] = mac_int[1];
|
||||
}
|
||||
else{
|
||||
// this board use default cali setting
|
||||
cdr_buf[5] = 0xAB;
|
||||
cdr_buf[6] = 0xCD;
|
||||
cdr_buf[6] = 0xAB;
|
||||
cdr_buf[7] = 0xCD;
|
||||
}
|
||||
|
||||
|
||||
@@ -887,6 +901,10 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
|
||||
}
|
||||
|
||||
default: {
|
||||
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++ ){
|
||||
cdr_buf[i] = 0;
|
||||
}
|
||||
|
||||
cdr_buf[0] = _B_4b4b(cis_oper, CHIP_ID);
|
||||
cdr_buf[1] = _B_4b4b(CDR_FAILURE, 0);
|
||||
|
||||
|
||||
+4
-4
@@ -3,14 +3,14 @@
|
||||
#define VERSION_DATE
|
||||
|
||||
#define VERSION_DATE_YEAR 20
|
||||
#define VERSION_DATE_MONTH 7
|
||||
#define VERSION_DATE_DAY 20
|
||||
#define VERSION_DATE_MONTH 8
|
||||
#define VERSION_DATE_DAY 14
|
||||
#define VERSION_DATE_HOUR 17
|
||||
#define VERSION_DATE_MINUTE 48
|
||||
#define VERSION_DATE_MINUTE 34
|
||||
|
||||
// this is NOT the version hash !!
|
||||
// it's the last version hash
|
||||
#define VERSION_HASH 81d5d86890d1da5dfb3ccc7e1756261c3ecbf485
|
||||
#define VERSION_HASH c347e44536488b3cfaa9e1ed2b4fbcb4513639ea
|
||||
#define VERSION_GIT_BRANCH Neulive20_developement_linux
|
||||
|
||||
static void get_board_name(char *board_name_ch, uint8 *board_name_int, uint8 name_size){
|
||||
|
||||
@@ -82,7 +82,7 @@ extern "C" {
|
||||
|
||||
// Length of Characteristic 5 in bytes
|
||||
#define SIMPLEPROFILE_CHAR1_LEN 2
|
||||
#define SIMPLEPROFILE_CHAR2_LEN 50
|
||||
#define SIMPLEPROFILE_CHAR2_LEN 34
|
||||
#define SIMPLEPROFILE_CHAR3_LEN 20
|
||||
#define SIMPLEPROFILE_CHAR4_LEN 200
|
||||
//#define SIMPLEPROFILE_CHAR4_LEN 20
|
||||
|
||||
Reference in New Issue
Block a user