主从机角色自动切换问题
我现在基于peripheral程序,把central部分的代码融合进从机程序,想实现一个模块能够主从机模式在一定时间内自动切换,现在遇到的问题是:peripheral程序用到的lib库是cc2540_BLE_peri.lib和cc254x_BLE_HCI_TL_None.lib; 如果我不把cc2540_BLE_cent.lib包含进来,程序中这样的函数GAP_EstablishLinkReq( ¶ms );GAP_DeviceDiscoveryRequest( ¶ms );都提示没有定义; 如果把cc2540_BLE_cent.lib加进去,编译的时候又提示Error[e6]: Program module ll_halt redeclared in file C:\Users\Desktop\BLE-CC254x-1.3\Projects\ble\Libraries\CC2540DB\ bin\CC2540_BLE_peri.lib ,好像是ll_halt在库中重声明了;请问这个问题该如何解决?
主从切换请参考这个文档: https://bluegiga.zendesk.com/entries/25053373--REFERENCE-BLE-master-slave-GATT-client-server-and-data-RX-TX-basics
去掉 CC2540_BLE_peri.lib cc2540_BLE_cent.lib
添加 CC2541_BLE.lib
hi Grap
按你说的去掉
去掉 CC2540_BLE_peri.lib cc2540_BLE_cent.lib
添加 CC2541_BLE.lib
会出现如下错误:
Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment XDATA_N. Unable to place 2
block(s) (0xc02 byte(s) total) in 0xb4d byte(s) of memory. The problem occurred while processing the segment placement
command "-P(XDATA)XDATA_N=_XDATA_START-_XDATA_END", where at the moment of placement the available
memory ranges were "XDATA:13b3-1eff"
INT_HEAP_LEN=3072 修改这个宏,在工程选项中.改小一点就可以了比如 INT_HEAP_LEN=1024