Compare commits
3 Commits
a9fc87afbc
...
43c63da8a9
Author | SHA1 | Date |
---|---|---|
|
43c63da8a9 | |
|
3416a7dd18 | |
|
bd990f7bd8 |
|
@ -1017,12 +1017,16 @@ static void ProcessRadioTxDone( void )
|
|||
Radio.Sleep( );
|
||||
}
|
||||
#if ( !defined(DISABLE_LORAWAN_RX_WINDOW) || (DISABLE_LORAWAN_RX_WINDOW == 0) )
|
||||
// Setup timers
|
||||
// Setup timers
|
||||
CRITICAL_SECTION_BEGIN( );
|
||||
uint32_t offset = TimerGetCurrentTime( ) - TxDoneParams.CurTime;
|
||||
TimerSetValue( &MacCtx.RxWindowTimer1, MacCtx.RxWindow1Delay - offset );
|
||||
uint32_t cur_time = TimerGetCurrentTime( );
|
||||
uint32_t offset = (cur_time >= TxDoneParams.CurTime) ? (cur_time - TxDoneParams.CurTime) : (cur_time+ (0XFFFFFFFF - TxDoneParams.CurTime + 1));
|
||||
uint32_t value1 = (MacCtx.RxWindow1Delay > offset) ? (MacCtx.RxWindow1Delay - offset) : MacCtx.RxWindow1Delay;
|
||||
TimerSetValue( &MacCtx.RxWindowTimer1, value1 );
|
||||
TimerStart( &MacCtx.RxWindowTimer1 );
|
||||
TimerSetValue( &MacCtx.RxWindowTimer2, MacCtx.RxWindow2Delay - offset );
|
||||
uint32_t value2 = (MacCtx.RxWindow2Delay > offset) ? (MacCtx.RxWindow2Delay - offset) : MacCtx.RxWindow2Delay;
|
||||
TimerSetValue( &MacCtx.RxWindowTimer2, value2 );
|
||||
TimerStart( &MacCtx.RxWindowTimer2 );
|
||||
CRITICAL_SECTION_END( );
|
||||
#else
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue