This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Ble stack server receiverlink loss

But in button event handler.

i want data to read from eeprom through i2c bus. and send it

through bluetooth stack for every press of buuton 0.

but in master control panel ,its says bluetooth connection loss ,once i press button 0.

Kindly tell me is it not possible to access i2c in button even handler.

static void button_event_handler(uint8_t pin_no) { switch (pin_no) { case HR_INC_BUTTON_PIN_NO:

//m_cur_heart_rate += HEART_RATE_CHANGE; m_cur_heart_rate = data2; dataW1[0]=dataW1[0]+2; twi_master_transfer(addw, dataW1, 2, 1); twi_master_transfer(addr, data1, 2, 0); data2=(data1[0]<<4)|(data1[1]); break;

case HR_DEC_BUTTON_PIN_NO:

//m_cur_heart_rate -= HEART_RATE_CHANGE; //if (m_cur_heart_rate < MIN_HEART_RATE) // { // m_cur_heart_rate = MAX_HEART_RATE; // Loop back // } break;

default: APP_ERROR_HANDLER(pin_no); } }

Parents
  • Hi Hung Bui,

    Actually my device connection to eeprom is broken. so i think it is not writing data . sorry

    for wrong reply. but now it is writing data to eeprom and reading fine. (i saw by keeping break point).

    but once i flash code ,and press the button 0 ,it is not giving advertisement ,so i cant send the data

    over bluetooth stack. can you say why advertisement is not coming when i enable soft device api.

    (But i am getting advertisement when i use directly ppi address register)

    Regards Balaji

Reply
  • Hi Hung Bui,

    Actually my device connection to eeprom is broken. so i think it is not writing data . sorry

    for wrong reply. but now it is writing data to eeprom and reading fine. (i saw by keeping break point).

    but once i flash code ,and press the button 0 ,it is not giving advertisement ,so i cant send the data

    over bluetooth stack. can you say why advertisement is not coming when i enable soft device api.

    (But i am getting advertisement when i use directly ppi address register)

    Regards Balaji

Children
No Data
Related