Move out RFCOMM channel structure init code to a seperate routine, to save on compiled code space and to prevent copy-paste errors.
This commit is contained in:
parent
fbabecee66
commit
31a34154db
5 changed files with 61 additions and 46 deletions
|
@ -58,12 +58,15 @@ int main(void)
|
|||
|
||||
for (;;)
|
||||
{
|
||||
Bluetooth_Channel_t* RFCOMMChannel = Bluetooth_GetChannelData(CHANNEL_PSM_RFCOMM, CHANNEL_SEARCH_PSM);
|
||||
|
||||
/* If an RFCOMM channel is open, service the RFCOMM logical channels */
|
||||
if (RFCOMMChannel)
|
||||
RFCOMM_ServiceChannels(RFCOMMChannel);
|
||||
if (Bluetooth_Connection.IsConnected)
|
||||
{
|
||||
Bluetooth_Channel_t* RFCOMMChannel = Bluetooth_GetChannelData(CHANNEL_PSM_RFCOMM, CHANNEL_SEARCH_PSM);
|
||||
|
||||
/* If an RFCOMM channel is open, service the RFCOMM logical channels */
|
||||
if (RFCOMMChannel)
|
||||
RFCOMM_ServiceChannels(RFCOMMChannel);
|
||||
}
|
||||
|
||||
Bluetooth_Stack_USBTask();
|
||||
Bluetooth_Host_Task();
|
||||
USB_USBTask();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue