update print
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include "util.h"
|
||||
#include "error.h"
|
||||
|
||||
+24
-24
@@ -146,7 +146,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_ctrl_init(&descPtr, &intc_init_param);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Intc Init FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("Intc Init FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -160,21 +160,21 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_trigger_level_set(descPtr, PHY_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set highest interrupt priority
|
||||
Status = irq_set_priority(descPtr, PHY_INTR_ID, 0x08);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Connect the interrupt service routine isr1 to the interrupt controller
|
||||
Status = irq_register_callback(descPtr, PHY_INTR_ID, &phy_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -182,21 +182,21 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_trigger_level_set(descPtr, PERIODIC_5MS_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set highest interrupt priority
|
||||
Status = irq_set_priority(descPtr, PERIODIC_5MS_INTR_ID, 0x00);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Connect the interrupt service routine isr1 to the interrupt controller
|
||||
Status = irq_register_callback(descPtr, PERIODIC_5MS_INTR_ID, &periodicpull_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -204,14 +204,14 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
// Status = irq_trigger_level_set(descPtr, SYSBUS_TX_INTR_ID, IRQ_EDGE_RISING);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
// // Set interrupt priority
|
||||
// Status = irq_set_priority(descPtr, SYSBUS_TX_INTR_ID, 0x10);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
//
|
||||
@@ -219,20 +219,20 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
// Status = irq_register_callback(descPtr, SYSBUS_TX_INTR_ID, &sysbus_tx_callback_desc);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
// Status = irq_trigger_level_set(descPtr, SYSBUS_RX_INTR_ID, IRQ_EDGE_RISING);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
// // Set interrupt priority
|
||||
// Status = irq_set_priority(descPtr, SYSBUS_RX_INTR_ID, 0x18);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
//
|
||||
@@ -240,7 +240,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
// Status = irq_register_callback(descPtr, SYSBUS_RX_INTR_ID, &sysbus_rx_callback_desc);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
//
|
||||
@@ -249,7 +249,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
// Status = irq_register_callback(descPtr, SCUTIMER_INTR_ID, &scutm_callback_desc);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
// DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
|
||||
@@ -264,7 +264,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_global_enable(descPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("IRQ global enable FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("IRQ global enable FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
return SUCCESS;
|
||||
@@ -301,7 +301,7 @@ void PeriodicPull_Handler(void *callBackRef)
|
||||
Status = Linklayer_Proc(linkInstPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Link layer runs failed, with error code: %ld\n", Status);
|
||||
DBG_ERROR("Link layer runs failed, with error code: %" PRId32 "\n", Status);
|
||||
_nop_();
|
||||
}
|
||||
} // PeriodicPull_Handler
|
||||
@@ -321,7 +321,7 @@ void Systembus_RxIntrHandler(void *context)
|
||||
Status = SystemBus_RxIntrHandler(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_RxIntrHandler exit with error code %ld,\n", Status);
|
||||
DBG_ERROR("SystemBus_RxIntrHandler exit with error code %" PRId32 ",\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ void Systembus_TxIntrHandler(void *context)
|
||||
Status = SystemBus_TxIntrHandler(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_TxIntrHandler exit with error code %ld,\n", Status);
|
||||
DBG_ERROR("SystemBus_TxIntrHandler exit with error code %" PRId32 ",\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ void ScuTimer_IntrHandler(void *context)
|
||||
******************************************************************************/
|
||||
int main(void)
|
||||
{
|
||||
int Status;
|
||||
int32_t Status;
|
||||
DBG_PRINT("Application Version: %2d.%2d.%4d.\n", _APP_VER_MAIN, _APP_VER_MINOR, _APP_VER_PATCH);
|
||||
|
||||
/* System Monitor Initialize */
|
||||
@@ -449,7 +449,7 @@ int main(void)
|
||||
// Status = SystemBus_Init(&sysbusDescPtr, &sysbusConfig);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("Systembus init FAILED, with error code: %d\n", Status);
|
||||
// DBG_ERROR("Systembus init FAILED, with error code: %" PRId32 "\n", Status);
|
||||
// return Status;
|
||||
// }
|
||||
|
||||
@@ -457,7 +457,7 @@ int main(void)
|
||||
Status = timer_init(&logTmPtr, &scutimer_init_param);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SCU Timer init FAILED, with error code: %d\n", Status);
|
||||
DBG_ERROR("SCU Timer init FAILED, with error code: %" PRId32 "\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ int main(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_ERROR("Interrupt system setup FAILED, ErrorCode: %d.\n", Status);
|
||||
DBG_ERROR("Interrupt system setup FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ int main(void)
|
||||
// Status = SystemBus_HandleCmd(sysbusDescPtr);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %d.\n", Status);
|
||||
// DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
// }
|
||||
// }
|
||||
// if (SystemBus_IsRsqPendding(sysbusDescPtr) && (!SystemBus_IsTxBusy(sysbusDescPtr)))
|
||||
@@ -501,7 +501,7 @@ int main(void)
|
||||
// Status = SystemBus_MakeResp(sysbusDescPtr);
|
||||
// if (Status != SUCCESS)
|
||||
// {
|
||||
// DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %d.\n", Status);
|
||||
// DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include "util.h"
|
||||
#include "error.h"
|
||||
@@ -39,7 +40,7 @@
|
||||
/* Stringify */
|
||||
#define STR(x) #x
|
||||
|
||||
// #define _DEBUG_LEVEL 3
|
||||
#define _DEBUG_LEVEL 3
|
||||
|
||||
#if _DEBUG_LEVEL > 0
|
||||
#define DBG_PRINT(...) printf(__VA_ARGS__)
|
||||
|
||||
+25
-25
@@ -147,7 +147,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_ctrl_init(&descPtr, &intc_init_param);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Intc Init FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("Intc Init FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -161,21 +161,21 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_trigger_level_set(descPtr, PHY_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set highest interrupt priority
|
||||
Status = irq_set_priority(descPtr, PHY_INTR_ID, 0x08);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Connect the interrupt service routine isr1 to the interrupt controller
|
||||
Status = irq_register_callback(descPtr, PHY_INTR_ID, &phy_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -183,21 +183,21 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_trigger_level_set(descPtr, PERIODIC_5MS_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set highest interrupt priority
|
||||
Status = irq_set_priority(descPtr, PERIODIC_5MS_INTR_ID, 0x00);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PERIODIC_5MS_INTR_ID priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Connect the interrupt service routine isr1 to the interrupt controller
|
||||
Status = irq_register_callback(descPtr, PERIODIC_5MS_INTR_ID, &periodicpull_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -205,14 +205,14 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_trigger_level_set(descPtr, SYSBUS_TX_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set interrupt priority
|
||||
Status = irq_set_priority(descPtr, SYSBUS_TX_INTR_ID, 0x10);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -220,20 +220,20 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_register_callback(descPtr, SYSBUS_TX_INTR_ID, &sysbus_tx_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
Status = irq_trigger_level_set(descPtr, SYSBUS_RX_INTR_ID, IRQ_EDGE_RISING);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR trigger level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
// Set interrupt priority
|
||||
Status = irq_set_priority(descPtr, SYSBUS_RX_INTR_ID, 0x18);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR priority level set FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_register_callback(descPtr, SYSBUS_RX_INTR_ID, &sysbus_rx_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_register_callback(descPtr, SCUTIMER_INTR_ID, &scutm_callback_desc);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("PHY_INTR register callback FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ int32_t SetupInterruptSystem(struct irq_ctrl_desc *descPtr)
|
||||
Status = irq_global_enable(descPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("IRQ global enable FAILED, ErrorCode: %ld.\n", Status);
|
||||
DBG_ERROR("IRQ global enable FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
return SUCCESS;
|
||||
@@ -302,7 +302,7 @@ void PeriodicPull_Handler(void *callBackRef)
|
||||
Status = Linklayer_Proc(linkInstPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Link layer runs failed, with error code: %ld\n", Status);
|
||||
DBG_ERROR("Link layer runs failed, with error code: %" PRId32 "\n", Status);
|
||||
_nop_();
|
||||
}
|
||||
} // PeriodicPull_Handler
|
||||
@@ -322,7 +322,7 @@ void Systembus_RxIntrHandler(void *context)
|
||||
Status = SystemBus_RxIntrHandler(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_RxIntrHandler exit with error code %ld,\n", Status);
|
||||
DBG_ERROR("SystemBus_RxIntrHandler exit with error code %" PRId32 ",\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void Systembus_TxIntrHandler(void *context)
|
||||
Status = SystemBus_TxIntrHandler(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_TxIntrHandler exit with error code %ld,\n", Status);
|
||||
DBG_ERROR("SystemBus_TxIntrHandler exit with error code %" PRId32 ",\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ int Hardware_Init(void)
|
||||
Status = hmc7044_init(&hmc7044_inst, &hmc7044_default_init_param);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("hmc7044_init() error: %ld\n", Status);
|
||||
DBG_ERROR("hmc7044_init() error: %" PRId32 "\n", Status);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ int Hardware_Init(void)
|
||||
******************************************************************************/
|
||||
int main(void)
|
||||
{
|
||||
int Status;
|
||||
int32_t Status;
|
||||
DBG_PRINT("Application Version: %2d.%2d.%4d.\n", _APP_VER_MAIN, _APP_VER_MINOR, _APP_VER_PATCH);
|
||||
|
||||
/* System Monitor Initialize */
|
||||
@@ -800,7 +800,7 @@ int main(void)
|
||||
Status = SystemBus_Init(&sysbusDescPtr, &sysbusConfig);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Systembus init FAILED, with error code: %d\n", Status);
|
||||
DBG_ERROR("Systembus init FAILED, with error code: %" PRId32 "\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ int main(void)
|
||||
Status = timer_init(&logTmPtr, &scutimer_init_param);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SCU Timer init FAILED, with error code: %d\n", Status);
|
||||
DBG_ERROR("SCU Timer init FAILED, with error code: %" PRId32 "\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ int main(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_ERROR("Interrupt system setup FAILED, ErrorCode: %d.\n", Status);
|
||||
DBG_ERROR("Interrupt system setup FAILED, ErrorCode: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -840,7 +840,7 @@ int main(void)
|
||||
Status = SystemBus_HandleCmd(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %d.\n", Status);
|
||||
DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
if (SystemBus_IsRsqPendding(sysbusDescPtr) && (!SystemBus_IsTxBusy(sysbusDescPtr)))
|
||||
@@ -850,7 +850,7 @@ int main(void)
|
||||
Status = SystemBus_MakeResp(sysbusDescPtr);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %d.\n", Status);
|
||||
DBG_ERROR("SystemBus_HandleCmd exit with ErrorCode: %" PRId32 ".\n", Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ static void L2_DataAvailUpdate(L2_INST *instPtr, bool status);
|
||||
static inline void UpdateMainSate(L2_INST *instPtr, L2_NODE_STATE newSate)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
DBG_INFO("MainStateUpdate: %d -> %d\n", instPtr->mainState, newSate);
|
||||
DBG_INFO("MainStateUpdate: %" PRId8 " -> %" PRId8 "\n", instPtr->mainState, newSate);
|
||||
instPtr->nextState = newSate;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ static inline void UpdateMainSate(L2_INST *instPtr, L2_NODE_STATE newSate)
|
||||
static void L2_SetSlotNum(L2_INST *instPtr, uint32_t newSlotNum)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
DBG_INFO("Set new slot number to %u\n", newSlotNum);
|
||||
DBG_INFO("Set new slot number to %" PRIu32 "\n", newSlotNum);
|
||||
instPtr->slotNum.next = newSlotNum;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ static void L2_SetSlotNum(L2_INST *instPtr, uint32_t newSlotNum)
|
||||
static void L2_SetFrameNum(L2_INST *instPtr, uint32_t newFrameNum)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
DBG_INFO("Set new frame number to %u\n", newFrameNum);
|
||||
DBG_INFO("Set new frame number to %" PRIu32 "\n", newFrameNum);
|
||||
instPtr->frameNum.next = newFrameNum;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ void L2_FrameStateUpdate(L2_INST *instPtr)
|
||||
else
|
||||
{
|
||||
DBG_INFO("A frame received, checking data validation...\n");
|
||||
DBG_INFO("Last frame type is: %u.\n", instPtr->frame.last);
|
||||
DBG_INFO("Last frame type is: %" PRId32 ".\n", instPtr->frame.last);
|
||||
Phy_RetrieveRecvData(phyRef, instPtr->recvPktData);
|
||||
instPtr->log.frameRecv++;
|
||||
|
||||
@@ -457,7 +457,7 @@ int32_t L2_SteerBeam2Node(L2_INST *instPtr, uint8_t nodeId)
|
||||
Status = L2_GetNodePos(instPtr->nodeList, nodeId, &dstPos);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Failed to retrieve position info of node %u, remain last configuration.\n", nodeId);
|
||||
DBG_ERROR("Failed to retrieve position info of node %" PRIu8 ", remain last configuration.\n", nodeId);
|
||||
return EPARAM;
|
||||
}
|
||||
myPos.x = instPtr->sysInfo.posX;
|
||||
@@ -593,7 +593,7 @@ int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE f
|
||||
frameStr = "UNKNOWN Frame";
|
||||
break;
|
||||
}
|
||||
DBG_INFO("# Setup Next Slot # [%u-%u], %s, %s.\n",
|
||||
DBG_INFO("# Setup Next Slot # [%" PRIu32 "-%" PRIu32 "], %s, %s.\n",
|
||||
instPtr->frameNum.next,
|
||||
instPtr->slotNum.next,
|
||||
torStr, frameStr);
|
||||
@@ -609,7 +609,7 @@ int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE f
|
||||
Status = Phy_SetTimeWord(phyRef, &pullTime, PHY_TIME_WORD_POLL);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Physical set pull time failed, with error code: %d\n", Status);
|
||||
DBG_ERROR("Physical set pull time failed, with error code: %" PRId32 "\n", Status);
|
||||
}
|
||||
|
||||
PHY_TOR_TYPE tor;
|
||||
@@ -625,14 +625,14 @@ int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE f
|
||||
tor = PHY_TOR_RX;
|
||||
break;
|
||||
default:
|
||||
DBG_ERROR("Invalid txrx mode :%d.\n", txrxMode);
|
||||
DBG_ERROR("Invalid txrx mode :%" PRId8 ".\n", txrxMode);
|
||||
return EPARAM;
|
||||
}
|
||||
|
||||
Status = Phy_SetupNextSlot(phyRef, tor, L2_L2frame2L1frame(frameType), instPtr->sendPktData);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Physical setup failed, with error code: %d\n", Status);
|
||||
DBG_ERROR("Physical setup failed, with error code: %" PRId32 "\n", Status);
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
@@ -768,14 +768,14 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
Status = L2_CreateSchedEventPool(&((*instPtr)->schdEventPool));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("L2_CreateSchedEventPool runs failed, with error code: %d.\n", Status);
|
||||
DBG_ERROR("L2_CreateSchedEventPool runs failed, with error code: %" PRId32 ".\n", Status);
|
||||
goto init_error;
|
||||
}
|
||||
|
||||
Status = L2_NodeList_Init(&((*instPtr)->nodeList));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("NodeList_Init runs failed, with error code: %d.\n", Status);
|
||||
DBG_ERROR("NodeList_Init runs failed, with error code: %" PRId32 ".\n", Status);
|
||||
goto init_error;
|
||||
}
|
||||
|
||||
@@ -901,7 +901,10 @@ void Linklayer_Destroy(L2_INST *instPtr)
|
||||
int32_t Linklayer_Start(L2_INST *instPtr)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
instPtr->netStartTime = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) / L2_SLOTS_PER_FRAME + 1;
|
||||
// Set netStartTime at first call.
|
||||
if (instPtr->netStartTime == NET_START_TIME_INFTY) {
|
||||
instPtr->netStartTime = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) / L2_SLOTS_PER_FRAME + 1;
|
||||
}
|
||||
instPtr->isEnable = true;
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -996,7 +999,7 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
DBG_ERROR("Illegal event, only None_Head node can assert L2_EV_LOST_CXN.\n");
|
||||
break;
|
||||
}
|
||||
DBG_WARNING("Lost connection with head node [%d].\n", L2_GetHeadId(instPtr));
|
||||
DBG_WARNING("Lost connection with head node [%" PRId8 "].\n", L2_GetHeadId(instPtr));
|
||||
L2_Scan_Reset(instPtr->scanFSM);
|
||||
L2_Service_Reset(instPtr->serviceFSM);
|
||||
instPtr->cxn2Net = false;
|
||||
@@ -1030,7 +1033,7 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_WARNING("Unsupported routine state [%d], Continue withe previous routine table.\n", instPtr->nextState);
|
||||
DBG_WARNING("Unsupported routine state [%" PRId8 "], Continue withe previous routine table.\n", instPtr->nextState);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1044,7 +1047,7 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
}
|
||||
default:
|
||||
{
|
||||
DBG_WARNING("UNKNOWN Event %d asserted.\n", l2Event->event);
|
||||
DBG_WARNING("UNKNOWN Event %" PRId8 " asserted.\n", l2Event->event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1082,7 +1085,7 @@ int32_t Linklayer_PktHandler(L2_INST *instPtr, L2_FRAME_TYPE frameType)
|
||||
Status = L2_Service_PktHandler(instPtr, instPtr->recvPktData);
|
||||
break;
|
||||
default:
|
||||
DBG_WARNING("L2FrameHandler: UNKNOWN L2-FrameType %d", frameType);
|
||||
DBG_WARNING("L2FrameHandler: UNKNOWN L2-FrameType %" PRId8 "\n", frameType);
|
||||
Status = FAILURE;
|
||||
break;
|
||||
}
|
||||
@@ -1106,14 +1109,14 @@ static int32_t IntcNodeTTL(NODE_ENTRY *node, const void *param)
|
||||
static bool IsNodeConnected(NODE_ENTRY *node)
|
||||
{
|
||||
ASSERT(node != NULL);
|
||||
DBG_INFO("Node: %u, TTL: %u.\n", node->nodeInfo.nodeId, node->ttlCnt);
|
||||
DBG_INFO("Node: %" PRIu8 ", TTL: %" PRIu32 ".\n", node->nodeInfo.nodeId, node->ttlCnt);
|
||||
if (node->ttlCnt < LINK_BROCK_THRESHOLD)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_WARNING("Lost Connection to NODE %u.\n", node->nodeInfo.nodeId);
|
||||
DBG_WARNING("Lost Connection to NODE %" PRIu8 ".\n", node->nodeInfo.nodeId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1145,7 +1148,7 @@ static int32_t Linklayer_Routine(L2_INST *instPtr)
|
||||
instPtr->rtneConfig.curr = instPtr->rtneConfig.next;
|
||||
instPtr->rtneConfig.next = &(instPtr->rtneConfig.rtneTable[tableIndx][entryIndx]);
|
||||
rtneEntry = instPtr->rtneConfig.rtneTable[tableIndx][entryIndx];
|
||||
DBG_INFO("## Routine: %u-%u, Routine period: %u.\n", tableIndx, entryIndx, instPtr->rtneConfig.rtnePrd);
|
||||
DBG_INFO("## Routine: %" PRIu32 "-%" PRIu32 ", Routine period: %" PRIu32 ".\n", tableIndx, entryIndx, instPtr->rtneConfig.rtnePrd);
|
||||
|
||||
switch (rtneEntry.slotType)
|
||||
{
|
||||
@@ -1163,7 +1166,7 @@ static int32_t Linklayer_Routine(L2_INST *instPtr)
|
||||
Status = L2_Service_Routine(instPtr, &rtneEntry);
|
||||
break;
|
||||
default:
|
||||
DBG_ERROR("UNKNOWN slot type [%d].\n", rtneEntry.slotType);
|
||||
DBG_ERROR("UNKNOWN slot type [%" PRId8 "].\n", rtneEntry.slotType);
|
||||
return EPARAM;
|
||||
}
|
||||
|
||||
@@ -1218,7 +1221,7 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
||||
uint32_t nextTimeUnit = (TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1) / L2_SLOTS_PER_FRAME;
|
||||
if (nextTimeUnit < instPtr->netStartTime)
|
||||
{
|
||||
DBG_WARNING("Linklayer not start yet, next time unit: %u, start time unit: %u.\n",
|
||||
DBG_WARNING("Linklayer not start yet, next time unit: %" PRIu32 ", start time unit: %" PRIu32 ".\n",
|
||||
nextTimeUnit, instPtr->netStartTime);
|
||||
return EIGNORE;
|
||||
}
|
||||
@@ -1226,7 +1229,7 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
||||
// Update slot number.
|
||||
L2_UpdateSlotNum(instPtr);
|
||||
|
||||
DBG_INFO("######## Current frameNum: %u, SlotNum: %u ########\n",
|
||||
DBG_INFO("######## Current frameNum: %" PRIu32 ", SlotNum: %" PRIu32 " ########\n",
|
||||
instPtr->frameNum.curr, instPtr->slotNum.curr);
|
||||
|
||||
// Sync System info
|
||||
@@ -1240,7 +1243,7 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
||||
{
|
||||
if (Linklayer_PktHandler(instPtr, L2_GetLastOptFrameType(instPtr)) != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Failed to handle last received frame: %d.\n", L2_GetLastOptFrameType(instPtr));
|
||||
DBG_ERROR("Failed to handle last received frame: %" PRId8 ".\n", L2_GetLastOptFrameType(instPtr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,10 +159,10 @@ NODE_ENTRY *L2_AppendNode(NODE_LIST *list, uint8_t nodeId, L2_NODE_TYPE nodeType
|
||||
ASSERT(list != NULL);
|
||||
if (L2_isNodeInList(list, nodeId))
|
||||
{
|
||||
DBG_WARNING("Node [%d] already exist.\n", nodeId);
|
||||
DBG_WARNING("Node [%" PRIu8 "] already exist.\n", nodeId);
|
||||
return NULL;
|
||||
}
|
||||
DBG_INFO("Link layer appending node [%d] to node list.\n", nodeId);
|
||||
DBG_INFO("Link layer appending node [%" PRIu8 "] to node list.\n", nodeId);
|
||||
NODE_ENTRY *nodeEntry = (NODE_ENTRY *)malloc(sizeof(NODE_ENTRY));
|
||||
if (nodeEntry == NULL)
|
||||
{
|
||||
@@ -208,10 +208,10 @@ int32_t L2_DeleteNodeById(NODE_LIST *list, uint8_t nodeId)
|
||||
clist_node_t *node = clist_find(list, &util_entry);
|
||||
if (node == NULL)
|
||||
{
|
||||
DBG_WARNING("Node [%d] in not in node list, skip deleting process.\n", nodeId);
|
||||
DBG_WARNING("Node [%" PRIu8 "] in not in node list, skip deleting process.\n", nodeId);
|
||||
return SUCCESS;
|
||||
}
|
||||
DBG_INFO("Deleting node [%d].\n", nodeId);
|
||||
DBG_INFO("Deleting node [%" PRIu8 "].\n", nodeId);
|
||||
clist_remove(list, node);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
static inline void LockStateUpdate(L2_SCAN_FSM *scanFsmPtr, bool state)
|
||||
{
|
||||
ASSERT(scanFsmPtr != NULL);
|
||||
DBG_INFO("Update BeamLockState from [%d] to [%d].\n",
|
||||
DBG_INFO("Update BeamLockState from [%" PRId8 "] to [%" PRId8 "].\n",
|
||||
scanFsmPtr->isLocked, state);
|
||||
scanFsmPtr->isLocked = state;
|
||||
return;
|
||||
@@ -65,7 +65,7 @@ static inline void LockStateUpdate(L2_SCAN_FSM *scanFsmPtr, bool state)
|
||||
static void AdvRecvStateUpdate(L2_SCAN_FSM *scanFsmPtr, bool state)
|
||||
{
|
||||
ASSERT(scanFsmPtr != NULL);
|
||||
DBG_INFO("Update AdvRecvState from [%d] to [%d].\n",
|
||||
DBG_INFO("Update AdvRecvState from [%" PRId8 "] to [%" PRId8 "].\n",
|
||||
scanFsmPtr->isAdvRecvd, state);
|
||||
scanFsmPtr->isAdvRecvd = state;
|
||||
return;
|
||||
@@ -95,7 +95,7 @@ static void PendCfmAck(L2_SCAN_FSM *scanFsmPtr)
|
||||
static void StageUpdate(L2_SCAN_FSM *scanFsmPtr, SCAN_STAGE newStage)
|
||||
{
|
||||
ASSERT(newStage >= L2_SCAN_NONE_STAGE && newStage <= L2_SCAN_CFM_STAGE);
|
||||
DBG_INFO("ScanNet current stage: %u -> ScanNet new stage: %u \n",
|
||||
DBG_INFO("ScanNet current stage: %" PRIu8 " -> ScanNet new stage: %" PRIu8 " \n",
|
||||
scanFsmPtr->scanStage, newStage);
|
||||
scanFsmPtr->scanStage = newStage;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ static int32_t Scan_InitScanHandler(L2_INST *instPtr)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_SCAN_FSM *scanFsmPtr = instPtr->scanFSM;
|
||||
DBG_INFO("** Net-Setup - InitScan Procedure (Attempts: %u)**\n", scanFsmPtr->scanCnt);
|
||||
DBG_INFO("** Net-Setup - InitScan Procedure (Attempts: %" PRIu8 ")**\n", scanFsmPtr->scanCnt);
|
||||
|
||||
if (scanFsmPtr->isLocked == true)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ static int32_t Scan_InitScanHandler(L2_INST *instPtr)
|
||||
static int32_t Scan_AdvHandler(L2_INST *instPtr)
|
||||
{
|
||||
L2_SCAN_FSM *scanFsmPtr = instPtr->scanFSM;
|
||||
DBG_INFO("** Net-Setup - Advertisement Procedure (Timeout: %u) **\n", scanFsmPtr->advTimeout);
|
||||
DBG_INFO("** Net-Setup - Advertisement Procedure (Timeout: %" PRIu8 ") **\n", scanFsmPtr->advTimeout);
|
||||
|
||||
// if received a valid bm frame.
|
||||
if (scanFsmPtr->isAdvRecvd == true)
|
||||
@@ -188,7 +188,7 @@ static int32_t Scan_AdvHandler(L2_INST *instPtr)
|
||||
static int32_t Scan_CfmHandler(L2_INST *instPtr)
|
||||
{
|
||||
L2_SCAN_FSM *scanFsmPtr = instPtr->scanFSM;
|
||||
DBG_INFO("** Net-Setup - Confirm Procedure (Timeout: %u) **\n", scanFsmPtr->cfmTimeout);
|
||||
DBG_INFO("** Net-Setup - Confirm Procedure (Timeout: %" PRIu8 ") **\n", scanFsmPtr->cfmTimeout);
|
||||
|
||||
// 2 way acq failed, back to init stage.
|
||||
if (scanFsmPtr->cfmTimeout >= CFM_LISTEN_TIMEOUT)
|
||||
@@ -227,7 +227,7 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
uint8_t *buff = instPtr->sendPktData;
|
||||
if(type < L2_ADV_FRAME || type > L2_CFM_FRAME)
|
||||
{
|
||||
DBG_ERROR("Unexpected frame type: %d.\n", type);
|
||||
DBG_ERROR("Unexpected frame type: %" PRId8 ".\n", type);
|
||||
return EPARAM;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
Status = L2_CrcAppend(buff, L2_ADV_PACK_LEN - L2_MSG_ADV_SVC_CRC_LEN, L2_MSG_ADV_SVC_CRC, L2_CRC16_1021);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Fail to append CRC, error code: %d.\n", Status);
|
||||
DBG_ERROR("Fail to append CRC, error code: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
break;
|
||||
@@ -282,14 +282,14 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
Status = L2_CrcAppend(buff, L2_CMF_PACK_LEN - L2_MSG_CFM_CRC_LEN, L2_MSG_CFM_CRC, L2_CRC16_1021);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("Fail to append CRC, error code: %d.\n", Status);
|
||||
DBG_ERROR("Fail to append CRC, error code: %" PRId32 ".\n", Status);
|
||||
return Status;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
DBG_ERROR("Unexpected frame type: %d.\n", type);
|
||||
DBG_ERROR("Unexpected frame type: %" PRId8 ".\n", type);
|
||||
return EPARAM;
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
node = L2_AppendNode(instPtr->nodeList, nodeId, L2_NODE_MEMBER);
|
||||
if(node == NULL)
|
||||
{
|
||||
DBG_ERROR("Failed to append new node [id: %d]", nodeId);
|
||||
DBG_ERROR("Failed to append new node [id: %" PRId8 "]", nodeId);
|
||||
Status = ENOMEM;
|
||||
break;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
node = L2_AppendNode(instPtr->nodeList, nodeId, L2_NODE_MEMBER);
|
||||
if(node == NULL)
|
||||
{
|
||||
DBG_ERROR("Failed to append new node [id: %d]", nodeId);
|
||||
DBG_ERROR("Failed to append new node [id: %" PRId8 "]", nodeId);
|
||||
Status = ENOMEM;
|
||||
break;
|
||||
}
|
||||
@@ -506,7 +506,7 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DBG_ERROR("Unsupported frame type: %d.\n", frameType);
|
||||
DBG_ERROR("Unsupported frame type: %" PRId8 ".\n", frameType);
|
||||
Status = EUNEXP;
|
||||
break;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ int32_t L2_Scan_Proc(L2_INST *instPtr)
|
||||
Status = Scan_CfmHandler(instPtr);
|
||||
break;
|
||||
default:
|
||||
DBG_ERROR("Unexpected scan net stage: %d.\n", scanFSM->scanStage);
|
||||
DBG_ERROR("Unexpected scan net stage: %" PRId8 ".\n", scanFSM->scanStage);
|
||||
Status = FAILURE;
|
||||
break;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
L2_SetupNextSlot(instPtr, torState, L2_CFM_FRAME);
|
||||
break;
|
||||
default:
|
||||
DBG_ERROR("Cannot start a routine for slot type [%d] properly.\n", rtneEntry->slotType);
|
||||
DBG_ERROR("Cannot start a routine for slot type [%" PRId8 "] properly.\n", rtneEntry->slotType);
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ L2_SCHD_EVENT *L2_CreatNewSchdEvent(L2_SCHD_POOL *schdPool, L2_EVENT_TYPE event,
|
||||
ASSERT(schdPool != NULL);
|
||||
if (event < L2_EV_SCAN_PROC_DONE || event > L2_ROUTINE_UPDATE)
|
||||
{
|
||||
DBG_ERROR("Unknown event type: %d.\n", event);
|
||||
DBG_ERROR("Unknown event type: %" PRId8 ".\n", event);
|
||||
return NULL;
|
||||
}
|
||||
L2_SCHD_EVENT *schdEvent = (L2_SCHD_EVENT *)malloc(sizeof(L2_SCHD_EVENT));
|
||||
@@ -192,7 +192,7 @@ L2_SCHD_EVENT *L2_GetEventById(L2_SCHD_POOL *schdPool, uint32_t id)
|
||||
clist_node_t *node = clist_find(schdPool->schdList, &util_schdevent);
|
||||
if (node != NULL)
|
||||
{
|
||||
DBG_WARNING("Event with id=%d, dose not exist.\n", id);
|
||||
DBG_WARNING("Event with id=%" PRIu32 ", dose not exist.\n", id);
|
||||
return NULL;
|
||||
}
|
||||
return ((L2_SCHD_EVENT *)node->val);
|
||||
@@ -217,7 +217,7 @@ int32_t L2_DeleteSchdEventById(L2_SCHD_POOL *schdPool, uint32_t id)
|
||||
clist_node_t *node = clist_find(schdPool->schdList, &util_schdevent);
|
||||
if (node != NULL)
|
||||
{
|
||||
DBG_ERROR("Event with id=%d, dose not exist.\n", id);
|
||||
DBG_ERROR("Event with id=%" PRIu32 ", dose not exist.\n", id);
|
||||
return EIGNORE;
|
||||
}
|
||||
clist_remove(schdPool->schdList, node);
|
||||
@@ -242,16 +242,16 @@ int32_t L2_ScheduleEventAt(L2_INST *instPtr, L2_SCHD_EVENT *schdEvent, uint32_t
|
||||
ASSERT(schdEvent != NULL);
|
||||
if (L2_isEventScheduled(schdEvent) == true)
|
||||
{
|
||||
DBG_ERROR("Event %d has already been scheduled.\n", schdEvent->eventId);
|
||||
DBG_ERROR("Event %" PRIu32 " has already been scheduled.\n", schdEvent->eventId);
|
||||
return FAILURE;
|
||||
}
|
||||
if (frameNum <= L2_GetCurrentFrameNum(instPtr) && slotNum < L2_GetCurrentSlotNum(instPtr))
|
||||
{
|
||||
DBG_ERROR("Cannot schedule event %d to the past(current: [%u-%u], schedule: [%u-%u]).\n",
|
||||
DBG_ERROR("Cannot schedule event %" PRIu32 " to the past(current: [%" PRIu32 "-%" PRIu32 "], schedule: [%" PRIu32 "-%" PRIu32 "]).\n",
|
||||
schdEvent->eventId, L2_GetCurrentFrameNum(instPtr), L2_GetCurrentSlotNum(instPtr), frameNum, slotNum);
|
||||
return FAILURE;
|
||||
}
|
||||
DBG_INFO("Schedule event (type:%d) [%u] at %u-%u.\n",
|
||||
DBG_INFO("Schedule event (type:%" PRIu8 ") [%" PRIu32 "] at %" PRIu32 "-%" PRIu32 ".\n",
|
||||
schdEvent->l2Event.event, schdEvent->eventId,
|
||||
frameNum, slotNum);
|
||||
schdEvent->isSchd = true;
|
||||
@@ -277,7 +277,7 @@ int32_t L2_ScheduleEventAfter(L2_INST *instPtr, L2_SCHD_EVENT *schdEvent, uint32
|
||||
ASSERT(schdEvent != NULL);
|
||||
if (L2_isEventScheduled(schdEvent) == true)
|
||||
{
|
||||
DBG_ERROR("Event %d has already been scheduled.\n", schdEvent->eventId);
|
||||
DBG_ERROR("Event %" PRIu32 " has already been scheduled.\n", schdEvent->eventId);
|
||||
return FAILURE;
|
||||
}
|
||||
uint32_t frameNum = L2_GetCurrentFrameNum(instPtr) + (numSlots / L2_SLOTS_PER_FRAME);
|
||||
@@ -303,7 +303,7 @@ int32_t L2_RescheduleEventAt(L2_INST *instPtr, L2_SCHD_EVENT *schdEvent, uint32_
|
||||
ASSERT(schdEvent != NULL);
|
||||
if (schdEvent->isSchd == false)
|
||||
{
|
||||
DBG_WARNING("Event %d has not been scheduled yet.\n", schdEvent->eventId);
|
||||
DBG_WARNING("Event %" PRIu32 " has not been scheduled yet.\n", schdEvent->eventId);
|
||||
}
|
||||
schdEvent->isSchd = false;
|
||||
return L2_ScheduleEventAt(instPtr, schdEvent, frameNum, slotNum);
|
||||
@@ -326,7 +326,7 @@ int32_t L2_RescheduleEventAfter(L2_INST *instPtr, L2_SCHD_EVENT *schdEvent, uint
|
||||
ASSERT(schdEvent != NULL);
|
||||
if (schdEvent->isSchd == false)
|
||||
{
|
||||
DBG_WARNING("Event %d has not been scheduled yet.\n", schdEvent->eventId);
|
||||
DBG_WARNING("Event %" PRIu32 " has not been scheduled yet.\n", schdEvent->eventId);
|
||||
}
|
||||
return L2_ScheduleEventAfter(instPtr, schdEvent, numSlots);
|
||||
}
|
||||
@@ -359,11 +359,11 @@ void L2_EventPoolHandler(L2_INST *instPtr)
|
||||
{
|
||||
if (event->schdFrame == L2_GetCurrentFrameNum(instPtr) && event->schdSlot == L2_GetCurrentSlotNum(instPtr))
|
||||
{
|
||||
DBG_INFO("Asserting scheduled event [%d].\n", event->eventId);
|
||||
DBG_INFO("Asserting scheduled event [%" PRIu32 "].\n", event->eventId);
|
||||
AssertL2Event(instPtr, &(event->l2Event));
|
||||
if (event->isVolatile == true)
|
||||
{
|
||||
DBG_INFO("Deleting scheduled event [%d], since it is volatile.\n", event->eventId);
|
||||
DBG_INFO("Deleting scheduled event [%" PRIu32 "], since it is volatile.\n", event->eventId);
|
||||
clist_remove(pool->schdList, node);
|
||||
}
|
||||
else
|
||||
@@ -407,7 +407,7 @@ inline int32_t L2_CancelEvent(L2_SCHD_EVENT *schdEvent)
|
||||
ASSERT(schdEvent != NULL);
|
||||
if (schdEvent->isSchd == false)
|
||||
{
|
||||
DBG_WARNING("Event %d has not been scheduled yet.\n", schdEvent->eventId);
|
||||
DBG_WARNING("Event %" PRIu32 " has not been scheduled yet.\n", schdEvent->eventId);
|
||||
}
|
||||
schdEvent->isSchd = false;
|
||||
return SUCCESS;
|
||||
|
||||
@@ -326,7 +326,7 @@ int32_t Phy_SetBeamAngle(PHY_INST *instPtr, double offAx, double rndAx)
|
||||
rndAxDeg = (rndAx >= 0) ? (((int32_t)(rndAx * 180 / ANT_PI)) % 360) : (((int32_t)(rndAx * 180 / ANT_PI)) % 360 + 360);
|
||||
if (offAxDeg > 60)
|
||||
{
|
||||
DBG_ERROR("Angle out of range, off axis angle: %u (should be 0~60), round axis angle: %u (should be 0~360).\n",
|
||||
DBG_ERROR("Angle out of range, off axis angle: %" PRIu16 " (should be 0~60), round axis angle: %" PRIu16 " (should be 0~360).\n",
|
||||
offAxDeg, rndAxDeg);
|
||||
return EPARAM;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ void Phy_Halt(PHY_INST *instPtr)
|
||||
uint32_t phyMainCtrl = PhyRead(instPtr, PHY_MAIN_CTRL);
|
||||
if ((phyMainCtrl & PHY_MAIN_CTRL_EN_MASK) == PHY_MAIN_CTRL_EN_DSBL)
|
||||
{
|
||||
DBG_WARNING("Physical layer was allready halted.\n");
|
||||
DBG_WARNING("Physical layer was already halted.\n");
|
||||
}
|
||||
instPtr->isPhyEn = false;
|
||||
PhyWrite(instPtr, PHY_MAIN_CTRL, (phyMainCtrl & (~PHY_MAIN_CTRL_EN_MASK)));
|
||||
|
||||
Reference in New Issue
Block a user