避免微网间隔和超时时间超大
This commit is contained in:
parent
90092ff0b7
commit
de46b80994
|
@ -74,7 +74,7 @@ ITransport* Create2401(SPI spi_, Pin ce, Pin irq, Pin power, bool powerInvert, I
|
|||
nrf->Init(spi, ce, irq, power);
|
||||
|
||||
auto tc = TinyConfig::Create();
|
||||
if(tc->Interval < 40)
|
||||
if(tc->New)
|
||||
{
|
||||
tc->Channel = 120;
|
||||
tc->Speed = 250;
|
||||
|
@ -123,7 +123,7 @@ ITransport* CreateShunCom(COM index, int baudRate, Pin rst, Pin power, Pin slp,
|
|||
{
|
||||
auto tc = TinyConfig::Create();
|
||||
debug_printf("tc->Interval %d\r\n",tc->Interval );
|
||||
if(tc->Interval == 0)
|
||||
if(tc->New)
|
||||
{
|
||||
tc->Channel = 0x0F;
|
||||
tc->Speed = 250;
|
||||
|
|
|
@ -220,7 +220,7 @@ TinyController::TinyController() : Controller()
|
|||
{
|
||||
bool flag = false;
|
||||
// 调整重发参数
|
||||
if(cfg->Interval == 0)
|
||||
if(cfg->Interval == 0 || cfg->Interval > 1000 || cfg->Timeout > 10000)
|
||||
{
|
||||
cfg->Interval = Interval;
|
||||
cfg->Timeout = Timeout;
|
||||
|
|
|
@ -212,7 +212,7 @@ ITransport* Token::Create2401(SPI spi_, Pin ce, Pin irq, Pin power, bool powerIn
|
|||
nrf.Init(&spi, ce, irq, power);
|
||||
|
||||
auto tc = TinyConfig::Create();
|
||||
if(tc->Interval == 0)
|
||||
if(tc->New)
|
||||
{
|
||||
tc->Channel = 120;
|
||||
tc->Speed = 250;
|
||||
|
@ -238,7 +238,7 @@ ITransport* Token::Create2401(SPI spi_, Pin ce, Pin irq, Pin power, bool powerIn
|
|||
ITransport* Token::CreateShunCom(COM index, int baudRate, Pin rst, Pin power, Pin slp, Pin cfg, IDataPort* led)
|
||||
{
|
||||
auto tc = TinyConfig::Create();
|
||||
if(tc->Interval == 0)
|
||||
if(tc->New)
|
||||
{
|
||||
tc->Channel = 0x0F;
|
||||
tc->Speed = 250;
|
||||
|
|
Loading…
Reference in New Issue