-
1. Re: How to set ID-timer ?
BoonT_56 Jun 10, 2015 1:54 AM (in response to userc_19040)We certainly have a catalog of threads on timer itself but I'm not sure have we begin to support IR, at least I don't see any sample app in the SDK.
-
2. Re: How to set ID-timer ?
userc_19040 Jun 10, 2015 2:40 AM (in response to BoonT_56)I found the good example implementing IR_TX.
Refer to below link. I succeed my ir_tx function.
http://community.broadcom.com/message/3621#3621
I am looking for any ID-timer defined by programmer.
-
3. Re: How to set ID-timer ?
BoonT_56 Jun 10, 2015 11:33 PM (in response to userc_19040)You may check out the below where they described the timer callback using the hw_timer.h
-
-
5. Re: How to set ID-timer ?
userc_19040 Jun 17, 2015 3:37 AM (in response to BoonT_56)I use bt_clock_based_periodic_timer_Enable() function to implement various Timers.
I manage to implement IR LED on-off functions .
I wonder my ir code produces different timing in IR_LED on`.
My ir code is as below.(Repeating between holding IR_LED on 200ms and IR LED off 200ms)
I call bt_clock_based_periodic_timer_Enable(application_timer_expired_callback, NULL, 400000/625);
The registered callback function repeats.
int application_timer_expired_callback(void* context)
{
// 400 ms timer callback, do something.
ble_trace1("\rtimer_expired_callback()=%ld",ir_tx_ms);
irtx_abortCurrentTransaction();
//Todo: do you actions here every 1 second
send_buffer[0]=HIGH(3400);
send_buffer[1]=HIGH(3400);
send_buffer[2]=HIGH(3400);
send_buffer[3]=HIGH(3400);
send_buffer[4]=HIGH(3400);
send_buffer[5]=HIGH(3400);
send_buffer[6]=HIGH(3400);
send_buffer[7]=HIGH(3400);
//Send IR Code in 120 second.
if(ir_tx_ms < 120000)
{
irtx_sendData(send_buffer, 8, irtxClockSet);
ir_tx_ms=ir_tx_ms+400;
}else{
bt_clock_based_periodic_timer_Disable();
}
// Context was not allocated and so does not need to be freed. So return no action.
return BLE_APP_EVENT_NO_ACTION;
}
The below picture says IR timing in the oscilloscope measurement.
The red rectangles show IR wave forms. I wonder why my code produces different IR wave forms.
I just repeat the same buffer value in my source code.
Thanks in advance.
-
6. Re: How to set ID-timer ?
jota_1939431 Jun 18, 2015 11:09 AM (in response to userc_19040)Hello Victor,
1. The BT clock only gets multiple of 1.25 milliseconds,
2. The bt_clock_based_periodic_timer_enable is not serialized, so application timer as far as callback is going to be called in interupted context
3. If you enable ble trace in this function the connection might eventually drop
4. You cannot trace in this function - It has to be in app thread context which means you have to rewrite this function.
5. You need to post event to the application thread.
6. If you look at the running speed cadence, below, which does event seralization, you can trace as much as you like.
7. If you want timing, check on hw_timer.h it is the right thing to do.
8. Since you only get multiple of 1.25 milliseconds, bt blcock based periodic timer is not serialized.
9. If you are performing "long running stuff" your connection can be droppped.
10. If you want more accurate timing use hw_timer.h and the link is here http://community.broadcom.com/thread/4768Hope this helps
Thanks
JT
-