Skip to content

Commit

Permalink
Merge pull request #502 from hello/integration
Browse files Browse the repository at this point in the history
1.5.5
  • Loading branch information
zer0page authored Sep 8, 2016
2 parents 61950a8 + 2119847 commit 6737349
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 34 deletions.
4 changes: 2 additions & 2 deletions common/app_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* A place to put all common defines
*/
//make sure the FW_VERSION_STRING fits in MorpheusCommand.top_version (16 bytes)
#define FW_VERSION_STRING "1.5.4"
#define FW_VERSION_STRING "1.5.5"

//pill only
#define FIRMWARE_VERSION_8BIT (54)
#define FIRMWARE_VERSION_8BIT (55)

#define BLE_SIG_COMPANY_ID 998

Expand Down
32 changes: 3 additions & 29 deletions morpheus/hble.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,35 +737,9 @@ void hble_params_init(const char* device_name, uint64_t device_id, uint32_t _cc3
#endif
memcpy(mod_num, ble_mode_num, strlen(ble_mode_num));
uint8_t mod_num_len = strlen(ble_mode_num);

mod_num[mod_num_len] = ':';
size_t cc_ver_len = 1;
uint32_t tmp = _cc3200_verion;
PRINTS("CC VER: ");
PRINT_HEX(&_cc3200_verion, sizeof(_cc3200_verion));
PRINTS("\r\n");

while(tmp / 10 > 0){
cc_ver_len++;
tmp = tmp / 10;
}
tmp = _cc3200_verion;

if(mod_num_len + cc_ver_len + 1 >= sizeof(mod_num)){
PRINTS("Model name string tooooo long\r\n");
nrf_delay_ms(100);
APP_ASSERT(0); // fail loudly, the version name cannot be too long
}

PRINTS("CC VER LEN: ");
PRINT_HEX(&cc_ver_len, sizeof(cc_ver_len));
PRINTS("\r\n");

for(int i = cc_ver_len - 1; i >= 0; i--)
{
mod_num[mod_num_len + 1 + i] = '0' + tmp % 10;
tmp /= 10;
}
if(mod_num_len >= sizeof(mod_num) - 1){
APP_ASSERT(0);
}

ble_srv_ascii_to_utf8(&dis_init.manufact_name_str, BLE_MANUFACTURER_NAME);
ble_srv_ascii_to_utf8(&dis_init.model_num_str, mod_num);
Expand Down
2 changes: 1 addition & 1 deletion pill/cli_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ _handle_command(int argc, char * argv[]){
PRINTS("\r\n");
}
//dispatch message through ANT
if(argc > 1 && !match_command(argv[0], "ant") ){
if(argc > 0 && !match_command(argv[0], "ant") ){
//Create a message object from uart string
_send_data_test();
}
Expand Down
2 changes: 1 addition & 1 deletion pill/message_imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static uint32_t _aggregate_motion_data(const int16_t* raw_xyz, size_t len)
++current->num_meas;
if(current->max_amp < aggregate){
current->max_amp = aggregate;
PRINTF( "NEW MAX: %d\r\n", aggregate);
PRINTF( "NEW MAX: %u\r\n", aggregate);
}
for(int i=0;i<3;++i){
current->avg_accel[i] += (values[i] - current->avg_accel[i])/current->num_meas;
Expand Down
2 changes: 1 addition & 1 deletion pill/timedfifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool TF_GetCondensed(MotionPayload_t* payload){
dot = ((uint64_t)dot*_fastinvsqrt(_mag(datum.prev_avg_accel)))>>16;

payload->cos_theta = _bitlog(dot);
uint32_t s = (_fastsqrt(datum.max_amp)) >> 7;
uint32_t s = (_fastsqrt(datum.max_amp)) >> 8;
if( s < UINT8_MAX ) {
payload->max = s;
}else{
Expand Down

0 comments on commit 6737349

Please sign in to comment.