diff --git a/cores/asr650x/Serial/HardwareSerial.cpp b/cores/asr650x/Serial/HardwareSerial.cpp index ba2524cc..e059fc35 100644 --- a/cores/asr650x/Serial/HardwareSerial.cpp +++ b/cores/asr650x/Serial/HardwareSerial.cpp @@ -61,8 +61,8 @@ void HardwareSerial::begin(unsigned long baud , uint32_t config, int8_t uart_num if( _uart_num == UART_NUM_0) { - if(digitalRead(UART_RX)==UART_RX_LEVEL)//uart start when uart chip powered - { + //if(digitalRead(UART_RX)==UART_RX_LEVEL)//uart start when uart chip powered + //{ uint32_t div = (float)CYDEV_BCLK__HFCLK__HZ/SerialBaud/UART_1_UART_OVS_FACTOR + 0.5 - 1; UART_1_Start(); UART_1_SCBCLK_DIV_REG = div<<8; @@ -70,7 +70,7 @@ void HardwareSerial::begin(unsigned long baud , uint32_t config, int8_t uart_num UART_1_RX_CTRL_REG =rx_ctrl1; UART_1_UART_TX_CTRL_REG =tx_ctrl0; UART_1_TX_CTRL_REG = tx_ctrl1; - } + //} } else { diff --git a/cores/asr650x/device/asr6501_lrwan/radio.c b/cores/asr650x/device/asr6501_lrwan/radio.c index d38e4730..5fcf9220 100644 --- a/cores/asr650x/device/asr6501_lrwan/radio.c +++ b/cores/asr650x/device/asr6501_lrwan/radio.c @@ -1118,11 +1118,13 @@ void RadioOnCadTimeoutIrq( void ) RadioEvents->CadDone( 0 ); } } - +extern uint8 UART_1_initVar; extern void enableUart(void); void RadioOnDioIrq( void ) { pinMode(P4_1,INPUT); + if(UART_1_initVar) + pinMode(P3_1,OUTPUT_PULLUP); IrqFired = true; RadioIrqProcess(); } diff --git a/cores/asr650x/loramac/mac/region/RegionCN470.c b/cores/asr650x/loramac/mac/region/RegionCN470.c index 247020f0..89ff5e1a 100644 --- a/cores/asr650x/loramac/mac/region/RegionCN470.c +++ b/cores/asr650x/loramac/mac/region/RegionCN470.c @@ -556,7 +556,7 @@ bool RegionCN470TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, TimerTime // Setup the radio frequency Radio.SetChannel( Channels[txConfig->Channel].Frequency ); - Radio.SetTxConfig( MODEM_LORA, phyTxPower, 0, 0, phyDr, 1, 16, false, true, 0, 0, false, 3000 ); + Radio.SetTxConfig( MODEM_LORA, phyTxPower, 0, 0, phyDr, 1, 16, false, true, 0, 0, false, 4000 ); FREQ_PRINTF("TX on freq %u Hz at DR %d power %d\r\n", (unsigned int)Channels[txConfig->Channel].Frequency, txConfig->Datarate,phyTxPower); // Setup maximum payload lenght of the radio driver diff --git a/cores/asr650x/loramac/system/low_power.c b/cores/asr650x/loramac/system/low_power.c index 34773fc6..ba541f89 100644 --- a/cores/asr650x/loramac/system/low_power.c +++ b/cores/asr650x/loramac/system/low_power.c @@ -110,6 +110,7 @@ uint32_t LowPower_GetState( void ) */ extern uint32_t systime; extern void systemTimer(); +extern uint8 UART_1_initVar; void lowPowerHandler( void ) { @@ -118,6 +119,8 @@ void lowPowerHandler( void ) if (LowPower_State == 0 && wakeByUart == false) { DBG_PRINTF_CRITICAL("dz\n\r"); pinMode(P4_1,ANALOG);// SPI0 MISO; + if(UART_1_initVar) + pinMode(P3_1,ANALOG); aos_lrwan_chg_mode.enter_stop_mode(); /* mcu dependent. to be implemented by user*/ aos_lrwan_chg_mode.exit_stop_mode(); @@ -125,6 +128,8 @@ void lowPowerHandler( void ) CySysTickSetCallback(4,systemTimer); systime = (uint32_t)TimerGetCurrentTime(); pinMode(P4_1,INPUT); + if(UART_1_initVar) + pinMode(P3_1,OUTPUT_PULLUP); } else { //DBG_PRINTF_CRITICAL("z\n\r"); aos_lrwan_chg_mode.enter_sleep_mode(); diff --git a/cores/asr650x/projects/CubeCellLib.a b/cores/asr650x/projects/CubeCellLib.a index 7f9aad64..da26ff4f 100644 Binary files a/cores/asr650x/projects/CubeCellLib.a and b/cores/asr650x/projects/CubeCellLib.a differ diff --git a/cores/asr650x/projects/PSoC4/CyLFClk.c b/cores/asr650x/projects/PSoC4/CyLFClk.c index b362261b..c6d487bb 100644 --- a/cores/asr650x/projects/PSoC4/CyLFClk.c +++ b/cores/asr650x/projects/PSoC4/CyLFClk.c @@ -2863,6 +2863,8 @@ cystatus CySysClkIloRestoreFactoryTrim(void) } } +extern uint8 UART_1_initVar; + /******************************************************************************* * Function Name: CySysTimerIsr ****************************************************************************//** @@ -2891,6 +2893,8 @@ cystatus CySysClkIloRestoreFactoryTrim(void) if(cySysTimerCallback[CY_SYS_TIMER0] != (void *) 0) { pinMode(P4_1,INPUT); + if(UART_1_initVar) + pinMode(P3_1, OUTPUT_PULLUP); (void)(cySysTimerCallback[CY_SYS_TIMER0])(); } } @@ -2906,6 +2910,8 @@ cystatus CySysClkIloRestoreFactoryTrim(void) if(cySysTimerCallback[CY_SYS_TIMER1] != (void *) 0) { pinMode(P4_1,INPUT); + if(UART_1_initVar) + pinMode(P3_1, OUTPUT_PULLUP); (void)(cySysTimerCallback[CY_SYS_TIMER1])(); } } @@ -2919,6 +2925,8 @@ cystatus CySysClkIloRestoreFactoryTrim(void) if(cySysTimerCallback[CY_SYS_TIMER2] != (void *) 0) { pinMode(P4_1,INPUT); + if(UART_1_initVar) + pinMode(P3_1, OUTPUT_PULLUP); (void)(cySysTimerCallback[CY_SYS_TIMER2])(); } }