mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-21 17:50:40 +00:00
Fixed some typos
This commit is contained in:
parent
dfbe5d5375
commit
2a2a48d1a7
2 changed files with 22 additions and 22 deletions
|
@ -255,7 +255,7 @@ void stopAdvertising() {
|
|||
}
|
||||
|
||||
void startActiveScanning() {
|
||||
float BleScanInterval = 60;
|
||||
float BleScanInterval = 60; // every 60ms
|
||||
float BleScanWindow = 60;
|
||||
float BleScanDivisor = 0.625;
|
||||
|
||||
|
@ -269,25 +269,6 @@ void startActiveScanning() {
|
|||
wait_msec(0x100000);
|
||||
}
|
||||
|
||||
void connect()
|
||||
{
|
||||
float BleScanInterval = 60;
|
||||
float BleScanWindow = 60;
|
||||
float BleScanDivisor = 0.625;
|
||||
|
||||
float connMinFreq = 30; // every 100ms
|
||||
float connMaxFreq = 50; // every 100ms
|
||||
float BleGranularity = 1.25;
|
||||
|
||||
unsigned int p = BleScanInterval / BleScanDivisor;
|
||||
unsigned int q = BleScanWindow / BleScanDivisor;
|
||||
|
||||
unsigned int min_interval = connMinFreq / BleGranularity;
|
||||
unsigned int max_interval = connMaxFreq / BleGranularity;
|
||||
|
||||
createLEconnection(lo(p), hi(p), lo(q), hi(q), 0, 0, lo(min_interval), hi(min_interval), lo(max_interval), hi(max_interval));
|
||||
}
|
||||
|
||||
void startActiveAdvertising() {
|
||||
float advertMinFreq = 100; // every 100ms
|
||||
float advertMaxFreq = 100; // every 100ms
|
||||
|
@ -300,3 +281,22 @@ void startActiveAdvertising() {
|
|||
setLEadvertdata();
|
||||
setLEadvertenable(1);
|
||||
}
|
||||
|
||||
void connect()
|
||||
{
|
||||
float BleScanInterval = 60; // every 60ms
|
||||
float BleScanWindow = 60;
|
||||
float BleScanDivisor = 0.625;
|
||||
|
||||
float connMinFreq = 30; // every 30ms
|
||||
float connMaxFreq = 50; // every 50ms
|
||||
float BleGranularity = 1.25;
|
||||
|
||||
unsigned int p = BleScanInterval / BleScanDivisor;
|
||||
unsigned int q = BleScanWindow / BleScanDivisor;
|
||||
|
||||
unsigned int min_interval = connMinFreq / BleGranularity;
|
||||
unsigned int max_interval = connMaxFreq / BleGranularity;
|
||||
|
||||
createLEconnection(lo(p), hi(p), lo(q), hi(q), 0, 0, lo(min_interval), hi(min_interval), lo(max_interval), hi(max_interval));
|
||||
}
|
||||
|
|
|
@ -146,8 +146,8 @@ void main()
|
|||
for (int c=5;c>=0;c--) uart_byte(local_addr[c]);
|
||||
uart_writeText("\n");
|
||||
|
||||
// Start scanning for devices around us
|
||||
/*
|
||||
// Start scanning for devices around us
|
||||
uart_writeText("startActiveScanning()\n");
|
||||
setLEeventmask(0xff);
|
||||
startActiveScanning();
|
||||
|
@ -156,8 +156,8 @@ void main()
|
|||
uart_writeText("connect()\n");
|
||||
connect();
|
||||
|
||||
// Get the Eddystone beacon going
|
||||
/*
|
||||
// Get the Eddystone beacon going
|
||||
uart_writeText("startActiveAdvertising()\n");
|
||||
startActiveAdvertising();
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue