Compare commits
26
Commits
a983e32a26
...
9e798cb8b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e798cb8b0 | ||
|
|
89e33f0f43 | ||
|
|
81037d042e | ||
|
|
94bcdccd5b | ||
|
|
bfc1a14a50 | ||
|
|
35ef220494 | ||
|
|
1b69f68298 | ||
|
|
f083920416 | ||
|
|
3e150f4a85 | ||
|
|
fcb9876675 | ||
|
|
f1a34a16bc | ||
|
|
c148795f1c | ||
|
|
3a78c3d2f2 | ||
|
|
37870ade8b | ||
|
|
48d1f3630f | ||
|
|
d0f9513bcd | ||
|
|
d10b0a451f | ||
|
|
a5acbdf05f | ||
|
|
b986cb921b | ||
|
|
ee149c040e | ||
|
|
acaf8da733 | ||
|
|
9518515748 | ||
|
|
fe89eb3b90 | ||
|
|
cfc0606e20 | ||
|
|
dd5588d672 | ||
|
|
d8d4b33853 |
@@ -23,11 +23,11 @@ $(PROCESSOR)/lib/libxil.a: $(PROCESSOR)/lib/libxil_init.a
|
||||
|
||||
%/make.include: $(if $(wildcard $(PROCESSOR)/lib/libxil_init.a),$(PROCESSOR)/lib/libxil.a,)
|
||||
@echo "Running Make include in $(subst /make.include,,$@)"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.libs: include
|
||||
@echo "Running Make libs in $(subst /make.libs,,$@)"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.clean:
|
||||
$(MAKE) -C $(subst /make.clean,,$@) -s clean
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/bit_array/%.o: ../src/bit_array/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/config/%.o: ../src/config/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ C_DEPS += \
|
||||
src/hardware/mykonos/%.o: ../src/hardware/mykonos/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ C_DEPS += \
|
||||
src/hardware/%.o: ../src/hardware/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/linklayer/geometry/%.o: ../src/linklayer/geometry/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ C_DEPS += \
|
||||
src/linklayer/%.o: ../src/linklayer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/mpc/%.o: ../src/mpc/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/phy_ctrl/%.o: ../src/phy_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/%.o: ../src/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/time_ctrl/%.o: ../src/time_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/util/%.o: ../src/util/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -I../bsp/ps7_cortexa9_0/include -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -87,7 +87,42 @@ static inline void L2_DataAvailUpdate(L2_INST* instPtr, bool status) {
|
||||
instPtr->dataAvail = status;
|
||||
}
|
||||
|
||||
L2_NODE_STATE L2_GetMainState(L2_INST* instPtr){
|
||||
/**
|
||||
* @brief Get the current node ID.
|
||||
*/
|
||||
inline uint8_t L2_GetNodeId(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->myInfo.nodeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current cluster ID.
|
||||
*/
|
||||
inline uint8_t L2_GetClusterId(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->myInfo.clustId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the head node ID.
|
||||
*/
|
||||
uint8_t L2_GetHeadId(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->myInfo.headId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current node type.
|
||||
*/
|
||||
inline L2_NODE_TYPE L2_GetNodeType(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->myInfo.nodeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current linklayer state.
|
||||
*/
|
||||
inline L2_NODE_STATE L2_GetMainState(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->mainState;
|
||||
}
|
||||
@@ -124,6 +159,22 @@ inline uint32_t L2_GetLastSlotNum(L2_INST* instPtr) {
|
||||
return instPtr->slotNum.last;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the frame type of last slot.
|
||||
*/
|
||||
inline L2_FRAME_TYPE L2_GetLastFrameType(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->frame.last;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the tx/rx state of last slot.
|
||||
*/
|
||||
inline L2_TOR_TYPE L2_GetLastTor(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->tor.last;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get current frame number.
|
||||
*/
|
||||
@@ -140,6 +191,22 @@ inline uint32_t L2_GetCurrentSlotNum(L2_INST* instPtr) {
|
||||
return instPtr->slotNum.curr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the frame type of current slot.
|
||||
*/
|
||||
inline L2_FRAME_TYPE L2_GetCurrentFrameType(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->frame.curr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the tx/rx state of current slot.
|
||||
*/
|
||||
inline L2_TOR_TYPE L2_GetCurrentTor(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->tor.curr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get next frame number.
|
||||
*/
|
||||
@@ -155,15 +222,36 @@ inline uint32_t L2_GetNextSlotNum(L2_INST* instPtr) {
|
||||
return instPtr->slotNum.next;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the frame type of next slot.
|
||||
*/
|
||||
inline L2_FRAME_TYPE L2_GetNextFrameType(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->frame.next;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the tx/rx state of next slot.
|
||||
*/
|
||||
inline L2_TOR_TYPE L2_GetNextTor(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->tor.next;
|
||||
}
|
||||
|
||||
// TODO: Multi-node RTT
|
||||
inline L2_RTT_FSM* L2_GetRttDesc(L2_INST* instPtr){
|
||||
/**
|
||||
* @brief Get the RTT FSM.
|
||||
*/
|
||||
inline L2_RTT_FSM* L2_GetRttFsm(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
return instPtr->rttFSM;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Creat a new schedule envent, register event in schedule event pool.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param event event type of the new schedule event.
|
||||
*
|
||||
* @return NULL error occurred
|
||||
@@ -201,7 +289,8 @@ L2_SCHD_EVENT* L2_CreatNewSchdEvent(L2_INST* instPtr, L2_EVENT_TYPE event){
|
||||
* @brief Delete a schedule event, remove the event from event pool,
|
||||
* release memory, release event ID.
|
||||
*
|
||||
* @param schdEvent pointer to the schedule event which is aboute to be deleted.
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param eventId ID of the event
|
||||
*
|
||||
* @return SUCCESS
|
||||
* error code
|
||||
@@ -230,7 +319,15 @@ int32_t L2_DeletSchdEvent(L2_INST* instPtr, int32_t eventId){
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Clear all event in the event pool.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void L2_ClearSchdEvent(L2_INST* instPtr){
|
||||
ASSERT(instPtr != NULL);
|
||||
for(int32_t i = 0; i < instPtr->schdEventCnt; i++){
|
||||
@@ -296,6 +393,7 @@ inline bool L2_isEventScheduled(L2_SCHD_EVENT* schdEvent){
|
||||
/**
|
||||
* @brief Schedule a event at a specific time(indexed by frame and slot number)
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param schdEvent pointer to the schedule event.
|
||||
* @param frameNum schedule frame number
|
||||
* @param slotNum schedule slot number
|
||||
@@ -325,6 +423,7 @@ int32_t L2_ScheduleEventAt(L2_INST* instPtr, L2_SCHD_EVENT* schdEvent, uint32_t
|
||||
/**
|
||||
* @brief Schedule a event after a specific time period.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param schdEvent pointer to the schedule event.
|
||||
* @param numSlots how many slot later the event should be scheduled
|
||||
*
|
||||
@@ -347,6 +446,7 @@ int32_t L2_ScheduleEventAfter(L2_INST* instPtr, L2_SCHD_EVENT* schdEvent, uint32
|
||||
/**
|
||||
* @brief Reschedule a event at a specific time(indexed by frame and slot number)
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param schdEvent pointer to the schedule event.
|
||||
* @param frameNum schedule frame number
|
||||
* @param slotNum schedule slot number
|
||||
@@ -368,14 +468,13 @@ int32_t L2_RecheduleEventAt(L2_INST* instPtr, L2_SCHD_EVENT* schdEvent, uint32_t
|
||||
/**
|
||||
* @brief Rechedule a event after a specific time period.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param schdEvent pointer to the schedule event.
|
||||
* @param numSlots how many slot later the event should be scheduled
|
||||
*
|
||||
* @return FAILURE, event has already been scheduled/schedule time not allowed.
|
||||
* SUCCESS
|
||||
*
|
||||
* @return NONE.
|
||||
*
|
||||
******************************************************************************/
|
||||
int32_t L2_RecheduleEventAfter(L2_INST* instPtr, L2_SCHD_EVENT* schdEvent, uint32_t numSlots){
|
||||
ASSERT(schdEvent != NULL);
|
||||
@@ -391,7 +490,7 @@ int32_t L2_RecheduleEventAfter(L2_INST* instPtr, L2_SCHD_EVENT* schdEvent, uint3
|
||||
/**
|
||||
* @brief Check and excute schedule event in event pool illiterate.
|
||||
*
|
||||
* @param NONE.
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
*
|
||||
* @return NONE.
|
||||
*
|
||||
@@ -423,31 +522,12 @@ inline void L2_RcdShift(L2_RCD* rcd, int32_t netxVal) {
|
||||
rcd->next = netxVal;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Get the valid frame data type received in last slot.
|
||||
*
|
||||
* @param NONE.
|
||||
*
|
||||
* @return NONE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
L2_FRAME_TYPE L2_GetLastRcvFrameType(L2_INST* instPtr) {
|
||||
if (instPtr->dataAvail == false) {
|
||||
return L2_NONE_FRAME;
|
||||
}
|
||||
else {
|
||||
return instPtr->frame.last;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Update L2 frame state, check if there is any valid L2 frame data in
|
||||
* data buffer, update receive frame status.
|
||||
*
|
||||
* @param NONE.
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
*
|
||||
* @return NONE.
|
||||
*
|
||||
@@ -472,6 +552,7 @@ void L2_FrameStateUpdate(L2_INST* instPtr) {
|
||||
|
||||
// Frame types shift (last <- curr <- next)
|
||||
L2_RcdShift(&(instPtr->frame), L2_NONE_FRAME);
|
||||
L2_RcdShift(&(instPtr->tor), L2_TOR_SUSPEND);
|
||||
|
||||
// Update frame state.
|
||||
if (Phy_IsFrameValid(phyRef) == false) {
|
||||
@@ -548,7 +629,7 @@ void L2_FrameStateUpdate(L2_INST* instPtr) {
|
||||
/**
|
||||
* @brief Layer 2 setup next slot operation, update current operating frame.
|
||||
*
|
||||
* @param instPtr a pointer to physical layer controller instance
|
||||
* @param instPtr a pointer to linklayer instance
|
||||
* @param txrxMode tx/rx state for next slot
|
||||
* @param frameType frame type of next slot.
|
||||
*
|
||||
@@ -559,7 +640,7 @@ void L2_FrameStateUpdate(L2_INST* instPtr) {
|
||||
int32_t L2_SetupNextSlot(L2_INST* instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE frameType) {
|
||||
ASSERT(instPtr != NULL);
|
||||
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
||||
int32_t Status = SUCCESS;
|
||||
int32_t Status;
|
||||
if (frameType < L2_INTER_SCAN_FRAME || frameType > L2_INTRA_SVC_FRAME) {
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -623,14 +704,17 @@ int32_t L2_SetupNextSlot(L2_INST* instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE f
|
||||
torStr, frameStr);
|
||||
#endif
|
||||
|
||||
// Update frame and tx/rx mode record.
|
||||
instPtr->frame.next = frameType;
|
||||
instPtr->tor.next = txrxMode;
|
||||
|
||||
TIME_WORD pullTime = {0, 0};
|
||||
pullTime.int_part = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr) + 1;
|
||||
Status = Phy_SetTimeWord(phyRef, &pullTime, TIME_WORD_POLL);
|
||||
if(Status != SUCCESS){
|
||||
DBG_ERROR("Physical set pull time failed, with error code: %d\n", Status);
|
||||
}
|
||||
instPtr->frame.next = frameType;
|
||||
|
||||
|
||||
PHY_TOR_TYPE tor;
|
||||
switch(txrxMode) {
|
||||
case L2_TOR_SUSPEND:
|
||||
@@ -821,22 +905,26 @@ int32_t Linklayer_Init(L2_INST** instPtr, const L2_CONFIG *config) {
|
||||
(*instPtr)->isEnable = false;
|
||||
(*instPtr)->cxn2Net = false;
|
||||
(*instPtr)->dataAvail = false;
|
||||
(*instPtr)->frame.last = L2_NONE_FRAME;
|
||||
(*instPtr)->frame.curr = L2_NONE_FRAME;
|
||||
(*instPtr)->frame.next = L2_NONE_FRAME;
|
||||
(*instPtr)->rtneConfig.rtneTable = initTable;
|
||||
(*instPtr)->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||
(*instPtr)->mainState = INIT_STATE;
|
||||
(*instPtr)->nextState = INIT_STATE;
|
||||
(*instPtr)->frameNum.last = 0;
|
||||
(*instPtr)->frameNum.curr = 0;
|
||||
(*instPtr)->frameNum.next = 0;
|
||||
(*instPtr)->slotNum.last = 0;
|
||||
(*instPtr)->slotNum.curr = 0;
|
||||
(*instPtr)->slotNum.next = 0;
|
||||
(*instPtr)->myInfo.nodeType = config->myType;
|
||||
(*instPtr)->frame.last = L2_NONE_FRAME;
|
||||
(*instPtr)->frame.curr = L2_NONE_FRAME;
|
||||
(*instPtr)->frame.next = L2_NONE_FRAME;
|
||||
(*instPtr)->tor.last = L2_TOR_SUSPEND;
|
||||
(*instPtr)->tor.curr = L2_TOR_SUSPEND;
|
||||
(*instPtr)->tor.next = L2_TOR_SUSPEND;
|
||||
(*instPtr)->rtneConfig.rtneTable = initTable;
|
||||
(*instPtr)->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||
(*instPtr)->mainState = INIT_STATE;
|
||||
(*instPtr)->nextState = INIT_STATE;
|
||||
(*instPtr)->myInfo.nodeId = config->myId;
|
||||
(*instPtr)->myInfo.clustId = config->clustId;
|
||||
(*instPtr)->myInfo.headId = config->headId;
|
||||
(*instPtr)->myInfo.nodeType = config->myType;
|
||||
(*instPtr)->myInfo.pos.x = 0;
|
||||
(*instPtr)->myInfo.pos.y = 0;
|
||||
(*instPtr)->myInfo.pos.z = 0;
|
||||
@@ -902,22 +990,26 @@ int32_t Linklayer_Reconfig(L2_INST* instPtr, const L2_CONFIG *config) {
|
||||
instPtr->rtneConfig.next = NULL;
|
||||
instPtr->cxn2Net = false;
|
||||
instPtr->dataAvail = false;
|
||||
instPtr->frame.last = L2_NONE_FRAME;
|
||||
instPtr->frame.curr = L2_NONE_FRAME;
|
||||
instPtr->frame.next = L2_NONE_FRAME;
|
||||
instPtr->rtneConfig.rtneTable = initTable;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||
instPtr->mainState = INIT_STATE;
|
||||
instPtr->nextState = INIT_STATE;
|
||||
instPtr->frameNum.last = 0;
|
||||
instPtr->frameNum.curr = 0;
|
||||
instPtr->frameNum.next = 0;
|
||||
instPtr->slotNum.last = 0;
|
||||
instPtr->slotNum.curr = 0;
|
||||
instPtr->slotNum.next = 0;
|
||||
instPtr->myInfo.nodeType = config->myType;
|
||||
instPtr->frame.last = L2_NONE_FRAME;
|
||||
instPtr->frame.curr = L2_NONE_FRAME;
|
||||
instPtr->frame.next = L2_NONE_FRAME;
|
||||
instPtr->tor.last = L2_TOR_SUSPEND;
|
||||
instPtr->tor.curr = L2_TOR_SUSPEND;
|
||||
instPtr->tor.next = L2_TOR_SUSPEND;
|
||||
instPtr->rtneConfig.rtneTable = initTable;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||
instPtr->mainState = INIT_STATE;
|
||||
instPtr->nextState = INIT_STATE;
|
||||
instPtr->myInfo.nodeId = config->myId;
|
||||
instPtr->myInfo.clustId = config->clustId;
|
||||
instPtr->myInfo.headId = config->headId;
|
||||
instPtr->myInfo.nodeType = config->myType;
|
||||
instPtr->myInfo.pos.x = 0;
|
||||
instPtr->myInfo.pos.y = 0;
|
||||
instPtr->myInfo.pos.z = 0;
|
||||
@@ -1013,7 +1105,7 @@ int32_t Linklayer_EventHandler(L2_INST* instPtr, const L2_EVENT* l2Event) {
|
||||
}
|
||||
case L2_EV_NET_SETUP_DONE: {
|
||||
DBG_INFO("Event L2_EV_NETSETUP_DONE asserted....\n");
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE){
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE){
|
||||
instPtr->cxn2Net = true;
|
||||
}
|
||||
else{ // Head node
|
||||
@@ -1031,7 +1123,7 @@ int32_t Linklayer_EventHandler(L2_INST* instPtr, const L2_EVENT* l2Event) {
|
||||
}
|
||||
case L2_EV_LOST_CXN: {
|
||||
DBG_INFO("Event L2_EV_LOST_CXN asserted....\n");
|
||||
DBG_WARNING("Lost connection with head node [%d].\n", instPtr->config.headId);
|
||||
DBG_WARNING("Lost connection with head node [%d].\n", L2_GetHeadId(instPtr));
|
||||
instPtr->cxn2Net = false;
|
||||
break;
|
||||
}
|
||||
@@ -1042,6 +1134,8 @@ int32_t Linklayer_EventHandler(L2_INST* instPtr, const L2_EVENT* l2Event) {
|
||||
case L2_ROUTINE_FINISH: {
|
||||
DBG_INFO("Event L2_ROUTINE_FINISH asserted....\n");
|
||||
if(instPtr->nextState == INIT_STATE){
|
||||
// Reset scan net FMS for next scan process.
|
||||
ScanNet_Reset(instPtr->scanNetFSM);
|
||||
UpdateMainSate(instPtr, NORMAL_STATE);
|
||||
instPtr->rtneConfig.rtneTable = normalTable;
|
||||
instPtr->rtneConfig.rtnePrd = ARRAY_SIZE(normalTable);
|
||||
@@ -1171,16 +1265,16 @@ static int32_t Linklayer_Routine (L2_INST* instPtr) {
|
||||
uint32_t tableIndx, entryIndx;
|
||||
|
||||
// FIXME: Consider time wrapping.
|
||||
uint32_t currTime = TimeCtrl_GetIntCnt(instPtr->config.tmcInstPtr)/L2_SLOTS_PER_FRAME;
|
||||
if(currTime < instPtr->netStartTime) {
|
||||
DBG_WARNING("Linklayer not start yet, current time unit: %u, start time unit: %u.\n",
|
||||
currTime, instPtr->netStartTime);
|
||||
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",
|
||||
nextTimeUnit, instPtr->netStartTime);
|
||||
return EIGNORE;
|
||||
}
|
||||
|
||||
// Determine which routine entry is going to be performed.
|
||||
tableIndx = L2_GetCurrentFrameNum(instPtr) % instPtr->rtneConfig.rtnePrd;
|
||||
entryIndx = L2_GetCurrentSlotNum(instPtr);
|
||||
tableIndx = L2_GetNextFrameNum(instPtr) % instPtr->rtneConfig.rtnePrd;
|
||||
entryIndx = L2_GetNextSlotNum(instPtr);
|
||||
L2_RTNE_TABLE_ENTRY rtneEntry = {0};
|
||||
|
||||
// Shift routine entry record.
|
||||
@@ -1190,9 +1284,6 @@ static int32_t Linklayer_Routine (L2_INST* instPtr) {
|
||||
rtneEntry = instPtr->rtneConfig.rtneTable[tableIndx][entryIndx];
|
||||
DBG_INFO("## Routine: %u-%u, Routine period: %u.\n", tableIndx, entryIndx, instPtr->rtneConfig.rtnePrd);
|
||||
|
||||
// Implement a RTT procedure.
|
||||
RTT_Proc(instPtr);
|
||||
|
||||
switch (rtneEntry.slotType) {
|
||||
case SLOT_IDLE:
|
||||
// Skip a 5ms slot.
|
||||
@@ -1266,11 +1357,11 @@ int32_t Linklayer_Proc(L2_INST* instPtr) {
|
||||
|
||||
// Handle frame received in last slot.
|
||||
if(L2_isDataAvail(instPtr) == true){
|
||||
Linklayer_PktHandler(instPtr, L2_GetLastRcvFrameType(instPtr));
|
||||
Linklayer_PktHandler(instPtr, L2_GetLastFrameType(instPtr));
|
||||
}
|
||||
|
||||
// Run Link layer routine, setup next slot procedure.
|
||||
if (instPtr->myInfo.nodeType == HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) == HEAD_NODE) {
|
||||
Phy_SetMode(instPtr->config.phyInstPtr, PHY_MODE_PULL);
|
||||
Status = Linklayer_Routine(instPtr);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ typedef struct {
|
||||
L2_RCD frameNum; // stores the last current and next frame number.
|
||||
L2_RCD slotNum; // stores the last current and next slot number.
|
||||
L2_RCD frame; // stores the last current and next link layer frame type.
|
||||
L2_RCD tor; // stores the last current and next link layer tx/rx state.
|
||||
L2_NODE_STATE mainState; // the main state of link layer state
|
||||
L2_NODE_STATE nextState; // next state of link layer state, which will be applied to mainState every second.
|
||||
L2_RTNE_CONFIG rtneConfig; // current routine table configuration and status.
|
||||
@@ -153,18 +154,28 @@ int32_t ServiceNet_PktHandler(L2_INST* instPtr);
|
||||
int32_t ServiceNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* schedEntry);
|
||||
|
||||
// Miscellaneous
|
||||
uint8_t L2_GetNodeId(L2_INST* instPtr);
|
||||
uint8_t L2_GetClusterId(L2_INST* instPtr);
|
||||
uint8_t L2_GetHeadId(L2_INST* instPtr);
|
||||
L2_NODE_TYPE L2_GetNodeType(L2_INST* instPtr);
|
||||
L2_NODE_STATE L2_GetMainState(L2_INST* instPtr);
|
||||
L2_RTT_FSM* L2_GetRttDesc(L2_INST* instPtr);
|
||||
L2_RTT_FSM* L2_GetRttFsm(L2_INST* instPtr);
|
||||
bool L2_isDataAvail(L2_INST* instPtr);
|
||||
bool L2_isCxn2Net(L2_INST* instPtr);
|
||||
void L2_RcdShift(L2_RCD* rcd, int32_t netxVal);
|
||||
uint32_t L2_GetFrameLen(L2_FRAME_TYPE l2FrameType);
|
||||
uint32_t L2_GetLastFrameNum(L2_INST* instPtr);
|
||||
uint32_t L2_GetLastSlotNum(L2_INST* instPtr);
|
||||
L2_FRAME_TYPE L2_GetLastFrameType(L2_INST* instPtr);
|
||||
L2_TOR_TYPE L2_GetLastTor(L2_INST* instPtr);
|
||||
uint32_t L2_GetCurrentFrameNum(L2_INST* instPtr);
|
||||
uint32_t L2_GetCurrentSlotNum(L2_INST* instPtr);
|
||||
L2_FRAME_TYPE L2_GetCurrentFrameType(L2_INST* instPtr);
|
||||
L2_TOR_TYPE L2_GetCurrentTor(L2_INST* instPtr);
|
||||
uint32_t L2_GetNextFrameNum(L2_INST* instPtr);
|
||||
uint32_t L2_GetNextSlotNum(L2_INST* instPtr);
|
||||
L2_FRAME_TYPE L2_GetNextFrameType(L2_INST* instPtr);
|
||||
L2_TOR_TYPE L2_GetNextTor(L2_INST* instPtr);
|
||||
|
||||
// Time syncronization
|
||||
int32_t L2_TimeAlign(L2_INST* instPtr, uint32_t frameNum, uint32_t slotNum);
|
||||
@@ -173,7 +184,7 @@ int32_t L2_TimeAlign(L2_INST* instPtr, uint32_t frameNum, uint32_t slotNum);
|
||||
int32_t RTT_Init(L2_RTT_FSM** rttFsmPtr);
|
||||
void RTT_Reset(L2_RTT_FSM* rttFsmPtr);
|
||||
void RTT_Destroy(L2_RTT_FSM* rttFsmPtr);
|
||||
int32_t RTT_Proc(L2_INST* instPtr);
|
||||
int32_t RTT_FsmUpdate(L2_INST* instPtr, L2_TOR_TYPE torType);
|
||||
|
||||
|
||||
#endif /* LINKLAYER814_H_ */
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "../phy_ctrl/phy_ctrl.h"
|
||||
/************************** Constant Definitions *****************************/
|
||||
// Common node ID definition
|
||||
#define BROADCAST_ID 0x1F
|
||||
#define NONE_ID BROADCAST_ID
|
||||
#define BROADCAST_ID 0x1F
|
||||
#define NONE_ID 0
|
||||
|
||||
// for MPC Configure
|
||||
#define MSG_STROAGE_BUFF_MAX 16384 // 16K Bytes
|
||||
@@ -93,6 +93,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
uint8_t nodeId;
|
||||
uint8_t clustId;
|
||||
uint8_t headId;
|
||||
L2_NODE_TYPE nodeType;
|
||||
uint8_t beamNo;
|
||||
COORD pos;
|
||||
@@ -198,8 +199,6 @@ typedef struct {
|
||||
uint8_t dst1;
|
||||
} L2_RTNE_TABLE_ENTRY;
|
||||
|
||||
|
||||
|
||||
// Scan net
|
||||
typedef struct {
|
||||
uint8_t NodeId;
|
||||
@@ -244,6 +243,7 @@ typedef struct {
|
||||
bool isLocked; // init acq done.
|
||||
bool isBmRcved;// bm received.
|
||||
bool isAcked; // 2way acq done.
|
||||
uint32_t scanCnt;
|
||||
uint32_t bmTimeout;
|
||||
uint32_t w2acqTimeout;
|
||||
SCAN_STAGE scanStage; // only for member node
|
||||
@@ -291,16 +291,6 @@ typedef struct {
|
||||
int32_t doppler;
|
||||
} RTT_MSG_RECORD;
|
||||
|
||||
typedef struct {
|
||||
uint32_t timeH;
|
||||
uint32_t timeL;
|
||||
} L2_TIME_WORD;
|
||||
|
||||
typedef struct {
|
||||
L2_TIME_WORD rttTime;
|
||||
uint32_t rttDoppler;
|
||||
} RTT_DATA;
|
||||
|
||||
typedef struct {
|
||||
bool isBisarProc;
|
||||
bool isPendTimeAlloc;
|
||||
@@ -308,10 +298,8 @@ typedef struct {
|
||||
MGMT_MSG_RECORD mgmtMsgLog;
|
||||
RTT_MSG_RECORD rttMsgRspLog;
|
||||
RTT_MSG_RECORD rttMsgReqLog;
|
||||
RTT_DATA rttData;
|
||||
} L2_MGMT_FSM;
|
||||
|
||||
|
||||
typedef struct{
|
||||
L2_RTNE_TABLE_ENTRY** rtneTable;
|
||||
uint32_t rtnePrd;
|
||||
|
||||
@@ -29,12 +29,9 @@
|
||||
#define INTER_MGMT_SLOTS 2
|
||||
#define INTRA_MGMT_SLOTS 1
|
||||
#define NONE_MGMT_SLOTS -1
|
||||
#define CONN_LOST_TH 10 // 10 count of mgmt msg no response to delete
|
||||
#define CONX_LOST_TH 10 // 10 count of mgmt msg no response to delete
|
||||
#define TIME2QUIT 80 // time to send quit message
|
||||
|
||||
#define SENDRTT 0
|
||||
#define RCVDRTT 1
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
/**************************** Type Definitions *******************************/
|
||||
@@ -56,8 +53,9 @@ static int32_t MgmtPkt_Packing(L2_INST* instPtr, MGMTPKT_TYPE pktType);
|
||||
/**
|
||||
* @brief Packing management message to a bit array.
|
||||
*
|
||||
* @param instPtr a pointer to l2 instance.
|
||||
* @param bitarr pointer to bit array buffer.
|
||||
* msgType message type.
|
||||
* @param msgType message type.
|
||||
*
|
||||
* @return EPARAM
|
||||
* SUCCESS
|
||||
@@ -66,17 +64,25 @@ static int32_t MgmtPkt_Packing(L2_INST* instPtr, MGMTPKT_TYPE pktType);
|
||||
static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE msgType) {
|
||||
ASSERT(instPtr != NULL);
|
||||
ASSERT(bitarr != NULL);
|
||||
if (bitarr->num_of_bits < MGMT_MSG_LEN || msgType < L2_MSG_TK_INIT
|
||||
|| msgType > L2_MSG_BCU_INIT) {
|
||||
uint64_t dataChunk;
|
||||
L2_RTT_FSM* rttFsmPtr = L2_GetRttFsm(instPtr);
|
||||
if (msgType < L2_MSG_TK_INIT || msgType > L2_MSG_BCU_INIT) {
|
||||
return EPARAM;
|
||||
}
|
||||
uint64_t dataChunk = 0;
|
||||
memset(bitarr->words, 0x99, (size_t) (MGMT_MSG_LEN / 8));
|
||||
switch (msgType) {
|
||||
case L2_MSG_TK_INIT:
|
||||
if(msgType >= L2_MSG_TK_INIT && msgType <= L2_MSG_MADJ_EXTD) {
|
||||
if (bitarr->num_of_bits < MGMT_MSG_LEN) {
|
||||
return EPARAM;
|
||||
}
|
||||
}
|
||||
if(msgType >= L2_MSG_RTT_REQ_INIT && msgType <= L2_MSG_RTT_RSP_CONT) {
|
||||
if (bitarr->num_of_bits < RTT_MSG_LEN) {
|
||||
return EPARAM;
|
||||
}
|
||||
}
|
||||
|
||||
memset(bitarr->words, 0x99, (size_t) (MGMT_MSG_LEN / 8));
|
||||
switch (msgType) {
|
||||
case L2_MSG_TK_INIT:
|
||||
// Series tag
|
||||
dataChunk = 0;
|
||||
FrameInsertChunk(bitarr, TK_MSG_INI_SER_TAG_OFFSET, TK_MSG_INI_SER_TAG_LEN, dataChunk);
|
||||
@@ -98,7 +104,7 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, TK_MSG_INI_OFFSET, TK_MSG_INI_LEN, dataChunk);
|
||||
|
||||
// Next net stage
|
||||
if (instPtr->myInfo.nodeType == HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) == HEAD_NODE) {
|
||||
switch (instPtr->nextState) {
|
||||
case INIT_STATE:
|
||||
dataChunk = NET_INI_STAGE;
|
||||
@@ -122,10 +128,8 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, TK_MSG_INI_NET_STATE_OFFSET, TK_MSG_INI_NET_STATE_LEN, dataChunk);
|
||||
}
|
||||
break;
|
||||
|
||||
case L2_MSG_TK_EXTD:
|
||||
if (bitarr->num_of_bits < MGMT_MSG_LEN) {
|
||||
return EPARAM;
|
||||
}
|
||||
// Word tag
|
||||
dataChunk = 1;
|
||||
FrameInsertChunk(bitarr, TK_MSG_EXTEND_WTAG_OFFSET, TK_MSG_EXTEND_WTAG_LEN, dataChunk);
|
||||
@@ -138,6 +142,7 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
dataChunk = 0xBBBB;
|
||||
FrameInsertChunk(bitarr, TK_MSG_EXTEND_EAST_SPEED_OFFSET, TK_MSG_EXTEND_EAST_SPEED_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
case L2_MSG_TK_CONT_1:
|
||||
// Word tag
|
||||
dataChunk = 2;
|
||||
@@ -178,6 +183,7 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
dataChunk = 0xBBBBBBBB;
|
||||
FrameInsertChunk(bitarr, TK_MSG_CONT_2_LATITUDE_OFFSET, TK_MSG_CONT_2_LATITUDE_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
case L2_MSG_TK_CONT_3:
|
||||
|
||||
// Word tag
|
||||
@@ -189,8 +195,7 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, TK_MSG_CONT_3_CONTID_OFFSET, TK_MSG_CONT_3_CONTID_LEN, dataChunk);
|
||||
|
||||
// source node id
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, TK_MSG_CONT_3_MEMBER_ADDR_OFFSET, TK_MSG_CONT_3_MEMBER_ADDR_LEN, dataChunk);
|
||||
|
||||
// East speed
|
||||
@@ -204,7 +209,6 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
// Upper speed
|
||||
dataChunk = 0xDDDD;
|
||||
FrameInsertChunk(bitarr, TK_MSG_CONT_3_UPPER_ACC_OFFSET, TK_MSG_CONT_3_UPPER_ACC_LEN, dataChunk);
|
||||
|
||||
break;
|
||||
|
||||
case L2_MSG_TA_INIT:
|
||||
@@ -222,15 +226,14 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, TA_MSG_MSG_STAG_OFFSET, TA_MSG_MSG_STAG_LEN, dataChunk);
|
||||
|
||||
// Source node id
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t) (L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, TA_MSG_SRC_ADDR_OFFSET, TA_MSG_SRC_ADDR_LEN, dataChunk);
|
||||
|
||||
// Height
|
||||
dataChunk = 0xEEEEEE;
|
||||
FrameInsertChunk(bitarr, TA_MSG_HEIGHT_OFFSET, TA_MSG_HEIGHT_LEN, dataChunk);
|
||||
|
||||
break;
|
||||
|
||||
case L2_MSG_TA_EXTD:
|
||||
|
||||
// Longitude
|
||||
@@ -262,12 +265,14 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
// Upper speed
|
||||
dataChunk = 0xDDDD;
|
||||
FrameInsertChunk(bitarr, TA_MSG_CONT_2_UPPER_OFFSET, TA_MSG_CONT_2_UPPER_LEN, dataChunk);
|
||||
|
||||
break;
|
||||
|
||||
case L2_MSG_MADJ_INIT:
|
||||
break;
|
||||
|
||||
case L2_MSG_MADJ_EXTD:
|
||||
break;
|
||||
|
||||
case L2_MSG_RTT_REQ_INIT:
|
||||
// Series tag
|
||||
dataChunk = 0;
|
||||
@@ -282,20 +287,19 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, RTT_REQ_MSG_TAG_OFFSET, RTT_REQ_MSG_TAG_LEN, dataChunk);
|
||||
|
||||
// message identification.
|
||||
dataChunk = 1;
|
||||
dataChunk = 1; // request
|
||||
FrameInsertChunk(bitarr, RTT_REQ_MSG_STAG_OFFSET, RTT_REQ_MSG_STAG_LEN, dataChunk);
|
||||
|
||||
// message length.
|
||||
dataChunk = 2; //request
|
||||
dataChunk = 2;
|
||||
FrameInsertChunk(bitarr, RTT_REQ_MSG_OFFSET, RTT_REQ_MSG_LEN, dataChunk);
|
||||
|
||||
// source node address length.
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, RTT_REQ_SRC_ADDR_OFFSET, RTT_REQ_SRC_ADDR_LEN, dataChunk);
|
||||
|
||||
// destination node address length.
|
||||
dataChunk = (0x02) | (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (0x02) | (((uint16_t) (L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, RTT_REQ_DST_ADDR_OFFSET, RTT_REQ_DST_ADDR_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
@@ -305,20 +309,20 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, RTT_REQ_EX_WTAG_OFFSET, RTT_REQ_EX_WTAG_LEN, dataChunk);
|
||||
|
||||
// Time tag Low.
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttTime.timeL;
|
||||
dataChunk = rttFsmPtr->timeStamp.frac_part;
|
||||
FrameInsertChunk(bitarr, RTT_REQ_EX_TTAGL_OFFSET, RTT_REQ_EX_TTAGL_LEN, dataChunk);
|
||||
|
||||
// Time tag High.
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttTime.timeH;
|
||||
dataChunk = rttFsmPtr->timeStamp.int_part;
|
||||
FrameInsertChunk(bitarr, RTT_REQ_EX_TTAGH_OFFSET, RTT_REQ_EX_TTAGH_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
case L2_MSG_RTT_REQ_CONT:
|
||||
// Doppler
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttDoppler;
|
||||
dataChunk = rttFsmPtr->doppler;
|
||||
FrameInsertChunk(bitarr, RTT_REQ_CONT_DOP_OFFSET, RTT_REQ_CONT_DOP_LEN, dataChunk);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
break;
|
||||
|
||||
case L2_MSG_RTT_RSP_INIT:
|
||||
// Series tag
|
||||
dataChunk = 0;
|
||||
@@ -334,7 +338,7 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
RTT_RSP_MSG_TAG_LEN, dataChunk);
|
||||
|
||||
// message identification.
|
||||
dataChunk = 2; // response
|
||||
dataChunk = 2; // response
|
||||
FrameInsertChunk(bitarr, RTT_RSP_MSG_STAG_OFFSET, RTT_RSP_MSG_STAG_LEN, dataChunk);
|
||||
|
||||
// message length.
|
||||
@@ -342,83 +346,84 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, RTT_RSP_MSG_OFFSET, RTT_RSP_MSG_LEN, dataChunk);
|
||||
|
||||
// source node address length.
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, RTT_RSP_SRC_ADDR_OFFSET, RTT_RSP_SRC_ADDR_LEN, dataChunk);
|
||||
|
||||
// destination node address length.
|
||||
dataChunk = (0x01) | (((uint16_t) (instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (0x01) | (((uint16_t) (L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, RTT_RSP_DST_ADDR_OFFSET, RTT_RSP_DST_ADDR_LEN, dataChunk);
|
||||
break;
|
||||
case L2_MSG_RTT_RSP_EXTD:
|
||||
|
||||
case L2_MSG_RTT_RSP_EXTD:
|
||||
// Word tag
|
||||
dataChunk = 1;
|
||||
FrameInsertChunk(bitarr, RTT_RSP_EX_WTAG_OFFSET, RTT_RSP_EX_WTAG_LEN, dataChunk);
|
||||
|
||||
// Time tag Low.
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttTime.timeL;
|
||||
dataChunk = rttFsmPtr->timeStamp.frac_part;
|
||||
FrameInsertChunk(bitarr, RTT_RSP_EX_TTAGL_OFFSET, RTT_RSP_EX_TTAGL_LEN, dataChunk);
|
||||
|
||||
// Time tag High.
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttTime.timeH;
|
||||
dataChunk = rttFsmPtr->timeStamp.int_part;
|
||||
FrameInsertChunk(bitarr, RTT_RSP_EX_TTAGH_OFFSET, RTT_RSP_EX_TTAGH_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
case L2_MSG_RTT_RSP_CONT:
|
||||
// Doppler
|
||||
dataChunk = instPtr->mgmtNetFSM->rttData.rttDoppler;
|
||||
dataChunk = rttFsmPtr->doppler;
|
||||
FrameInsertChunk(bitarr, RTT_RSP_CONT_DOP_OFFSET, RTT_RSP_CONT_DOP_LEN, dataChunk);
|
||||
break;
|
||||
|
||||
case L2_MSG_NQT_INIT:
|
||||
// if (priorInfo.myType == MEMBER_NODE && ( L2_GetCurrentFrameNo() == ( myInfo->netScanTime + TIME2QUIT ) )) {
|
||||
// // word tag
|
||||
// dataChunk = 3;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_WTAG_OFFSET,
|
||||
// NQT_MSG_WTAG_LEN, dataChunk);
|
||||
//
|
||||
// // msg tag
|
||||
// dataChunk = 30;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_TAG_OFFSET,
|
||||
// NQT_MSG_MSG_TAG_LEN, dataChunk);
|
||||
//
|
||||
// // msg sub tag
|
||||
// dataChunk = 1;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_STAG_OFFSET,
|
||||
// NQT_MSG_MSG_STAG_LEN, dataChunk);
|
||||
//
|
||||
// // msg length
|
||||
// dataChunk = 0;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_OFFSET,
|
||||
// NQT_MSG_MSG_LEN, dataChunk);
|
||||
//
|
||||
// // Ctrol Word
|
||||
// dataChunk = 1;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_CTRL_MUTE_OFFSET,
|
||||
// NQT_MSG_CTRL_MUTE_LEN, dataChunk);
|
||||
//
|
||||
// // Quit object
|
||||
// dataChunk = (priorInfo.myId & 0x1F)
|
||||
// | (((uint16_t) (priorInfo.clustId & 0x1F)) << 5);
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_OBJ_OFFSET,
|
||||
// NQT_MSG_OBJ_LEN, dataChunk);
|
||||
// L2_NODE_STATE newState = INIT_STATE;
|
||||
// L2_EVENT stateEvent = {
|
||||
// .event = L2_EV_MAIN_STATE_UPDATE,
|
||||
// .msg = &newState
|
||||
// };
|
||||
// AssertL2Event(&stateEvent);
|
||||
// L2_EVENT lostCxnEvent = {
|
||||
// .event = L2_EV_LOST_CXN,
|
||||
// .msg = NULL
|
||||
// };
|
||||
// AssertL2Event(&lostCxnEvent);
|
||||
// }
|
||||
// // word tag
|
||||
// dataChunk = 3;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_WTAG_OFFSET,
|
||||
// NQT_MSG_WTAG_LEN, dataChunk);
|
||||
|
||||
// // msg tag
|
||||
// dataChunk = 30;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_TAG_OFFSET,
|
||||
// NQT_MSG_MSG_TAG_LEN, dataChunk);
|
||||
|
||||
// // msg sub tag
|
||||
// dataChunk = 1;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_STAG_OFFSET,
|
||||
// NQT_MSG_MSG_STAG_LEN, dataChunk);
|
||||
|
||||
// // msg length
|
||||
// dataChunk = 0;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_MSG_OFFSET,
|
||||
// NQT_MSG_MSG_LEN, dataChunk);
|
||||
|
||||
// // Ctrol Word
|
||||
// dataChunk = 1;
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_CTRL_MUTE_OFFSET,
|
||||
// NQT_MSG_CTRL_MUTE_LEN, dataChunk);
|
||||
|
||||
// // Quit object
|
||||
// dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
// FrameInsertChunk(bitarr, NQT_MSG_OBJ_OFFSET, NQT_MSG_OBJ_LEN, dataChunk);
|
||||
// L2_NODE_STATE newState = INIT_STATE;
|
||||
// L2_EVENT stateEvent = {
|
||||
// .event = L2_EV_MAIN_STATE_UPDATE,
|
||||
// .msg = &newState
|
||||
// };
|
||||
// AssertL2Event(instPtr, &stateEvent);
|
||||
// L2_EVENT lostCxnEvent = {
|
||||
// .event = L2_EV_LOST_CXN,
|
||||
// .msg = NULL
|
||||
// };
|
||||
// AssertL2Event(instPtr, &lostCxnEvent);
|
||||
break;
|
||||
|
||||
case L2_MSG_CMG_INIT:
|
||||
break;
|
||||
|
||||
case L2_MSG_BCU_INIT:
|
||||
break;
|
||||
|
||||
default:
|
||||
DBG_ERROR("Unsupported message type: %d", msgType);
|
||||
return EPARAM;
|
||||
break;
|
||||
}
|
||||
@@ -426,7 +431,17 @@ static int32_t MgmtMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Packing management message to a bit array.
|
||||
*
|
||||
* @param instPtr a pointer to l2 instance.
|
||||
* @param pktType packet type.
|
||||
*
|
||||
* @return SUCCESS
|
||||
* error code
|
||||
*
|
||||
******************************************************************************/
|
||||
static int32_t MgmtPkt_Packing(L2_INST* instPtr, MGMTPKT_TYPE pktType) {
|
||||
ASSERT(instPtr != NULL);
|
||||
uint8_t* buff = instPtr->sendPktData;
|
||||
@@ -520,6 +535,15 @@ int32_t MgmtNet_Init(L2_MGMT_FSM** mgmtFSM) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Reset management net FSM.
|
||||
*
|
||||
* @param mgmtFSM a pointer to l2 management net FSM instance.
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void MgmtNet_Reset(L2_MGMT_FSM* mgmtFSM) {
|
||||
mgmtFSM->isBisarProc = false;
|
||||
mgmtFSM->isPendSlotAlloc = false;
|
||||
@@ -545,18 +569,28 @@ void MgmtNet_Reset(L2_MGMT_FSM* mgmtFSM) {
|
||||
// clear buffer.
|
||||
memset(&(mgmtFSM->rttMsgRspLog), 0x00, sizeof(RTT_MSG_RECORD));
|
||||
memset(&(mgmtFSM->rttMsgReqLog), 0x00, sizeof(RTT_MSG_RECORD));
|
||||
memset(&(mgmtFSM->rttData), 0x00, sizeof(RTT_DATA));
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Destroy management net FSM, free all allocated memory.
|
||||
*
|
||||
* @param mgmtFSM a pointer to l2 management net FSM instance.
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void MgmtNet_Destroy(L2_MGMT_FSM* mgmtFSM){
|
||||
free(mgmtFSM);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Handles management net packet, apply time sync and other management
|
||||
* net functions.
|
||||
*
|
||||
* @param msg A pointer to packet data buffer.
|
||||
* @param instPtr a pointer to l2 instance.
|
||||
*
|
||||
* @return SUCCESS Packet was successfully handled.
|
||||
* Other Packed was dumped(not addressed to me, unrecognized frame type)
|
||||
@@ -576,7 +610,7 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
free(mgmtMsg);
|
||||
return EALLOC;
|
||||
}
|
||||
switch (L2_GetLastRcvFrameType(instPtr)) {
|
||||
switch (L2_GetLastFrameType(instPtr)) {
|
||||
case L2_INTER_MGMT_FRAME:
|
||||
case L2_INTRA_MGMT_FRAME: {
|
||||
for (int i = 0; i < ARRAY_SIZE(intraMgmtFrameMsgs); i++) {
|
||||
@@ -597,6 +631,7 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
FrameGetChunk(mgmtMsg, TK_MSG_INI_STAG_OFFSET, TK_MSG_INI_STAG_LEN, &dataChunk);
|
||||
mgmtMsgLog->msgSubTag = (uint8_t) (dataChunk);
|
||||
|
||||
// Preventing the error response caused by unexpected bit error.
|
||||
if ( mgmtMsgLog->wordTag == 3
|
||||
&& mgmtMsgLog->msgTag == 28
|
||||
&& mgmtMsgLog->msgSubTag == 1 ) {
|
||||
@@ -641,7 +676,7 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
case L2_MSG_NQT_INIT:
|
||||
FrameGetChunk(mgmtMsg, NQT_MSG_OBJ_OFFSET, NQT_MSG_OBJ_LEN, &dataChunk);
|
||||
mgmtMsgLog->quitNodeId = (uint8_t) (dataChunk & 0x1F);
|
||||
if (mgmtMsgLog->quitNodeId != instPtr->myInfo.nodeId) {
|
||||
if (mgmtMsgLog->quitNodeId != L2_GetNodeId(instPtr)) {
|
||||
FrameGetChunk(mgmtMsg, NQT_MSG_CTRL_MUTE_OFFSET, NQT_MSG_CTRL_MUTE_LEN, &dataChunk);
|
||||
mgmtMsgLog->quitCtrlWord = (uint8_t)(dataChunk & 0x7F);
|
||||
if (mgmtMsgLog->quitCtrlWord == 0x01) {
|
||||
@@ -665,7 +700,7 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
}
|
||||
}
|
||||
// Member Node update state with received message
|
||||
if(instPtr->myInfo.nodeId != HEAD_NODE && mgmtMsgLog->isValid == true ){
|
||||
if(L2_GetNodeId(instPtr) != HEAD_NODE && mgmtMsgLog->isValid == true ){
|
||||
L2_NODE_STATE newState = NONE_STATE;
|
||||
// FIXME :
|
||||
switch (mgmtMsgLog->nextNetState) {
|
||||
@@ -695,18 +730,17 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
};
|
||||
AssertL2Event(instPtr, &stateUpEvent);
|
||||
}
|
||||
// TODO: Reset of tracking message src
|
||||
RstNodeTTL(instPtr->nodeList, mgmtMsgLog->srcNodeId);
|
||||
|
||||
if(mgmtMsgLog->srcNodeId == instPtr->config.headId){
|
||||
RstNodeTTL(instPtr->nodeList, mgmtMsgLog->srcNodeId);
|
||||
// TODO: Check
|
||||
if(mgmtMsgLog->srcNodeId == L2_GetHeadId(instPtr)){
|
||||
L2_TimeAlign(instPtr, L2_GetCurrentFrameNum(instPtr), L2_GetCurrentSlotNum(instPtr));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case L2_INTER_TSYNC_FRAME:
|
||||
case L2_INTRA_TSYNC_FRAME: {
|
||||
L2_RTT_FSM* rttFsmPtr = L2_GetRttDesc(instPtr);
|
||||
L2_RTT_SATGE rttStage = RTT_GetCurrentStage(rttFsmPtr);
|
||||
L2_RTT_SATGE rttStage = L2_GetRttFsm(instPtr)->rttStatge;
|
||||
if(rttStage == RTT_REQ1 || rttStage == RTT_REQ2){
|
||||
for (int i = 0; i < ARRAY_SIZE(rttReqFrameMsgs); i++) {
|
||||
memcpy(mgmtMsg->words,
|
||||
@@ -812,15 +846,16 @@ int32_t MgmtNet_PktHandler(L2_INST* instPtr) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: Reset of tracking message src
|
||||
|
||||
RstNodeTTL(instPtr->nodeList, rttMsgRspLog->srcAddr & 0x001F);
|
||||
if((rttMsgRspLog->srcAddr&0x001F) == instPtr->config.headId){
|
||||
// TODO: Check
|
||||
if((rttMsgRspLog->srcAddr&0x001F) == L2_GetHeadId(instPtr)){
|
||||
L2_TimeAlign(instPtr, L2_GetCurrentFrameNum(instPtr), L2_GetCurrentSlotNum(instPtr));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DBG_ERROR("Cannot handle frame type [%d] properly.\n", L2_GetLastRcvFrameType(instPtr));
|
||||
DBG_ERROR("Cannot handle frame type [%d] properly.\n", L2_GetLastFrameType(instPtr));
|
||||
Status = EPARAM;
|
||||
goto failed;
|
||||
}
|
||||
@@ -831,14 +866,21 @@ failed:
|
||||
return Status;
|
||||
}
|
||||
|
||||
// helper function
|
||||
|
||||
/**
|
||||
* @brief Helper function for check node TTL.
|
||||
* @param entry
|
||||
* @return trur/false
|
||||
*/
|
||||
static bool IsTTLValid(NODE_ENTRY* entry) {
|
||||
ASSERT(entry != NULL);
|
||||
return (entry->ttlCnt <= CONN_LOST_TH);
|
||||
return (entry->ttlCnt <= CONX_LOST_TH);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Management net FSM procedure.
|
||||
* @brief Management net FSM routine.
|
||||
*
|
||||
* @param mgmtFSM
|
||||
* mainState
|
||||
@@ -849,8 +891,6 @@ static bool IsTTLValid(NODE_ENTRY* entry) {
|
||||
int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
ASSERT(instPtr != NULL);
|
||||
int32_t Status;
|
||||
RTT_DATA *rttData = &(instPtr->mgmtNetFSM->rttData);
|
||||
RTT_RECORD *rttRecord = &(L2_GetRttDesc(instPtr)->rttRecord);
|
||||
DBG_INFO("-------- MgmtNet Routine --------\n");
|
||||
|
||||
if(rtneEntry->slotSeq != 0){
|
||||
@@ -862,18 +902,26 @@ int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
|
||||
// Determine next slot TOR state.
|
||||
L2_TOR_TYPE torState = L2_TOR_SUSPEND;
|
||||
if ((rtneEntry->src0 == instPtr->myInfo.nodeId)
|
||||
|| (rtneEntry->src1 == instPtr->myInfo.nodeId)) {
|
||||
if ((rtneEntry->src0 == L2_GetNodeId(instPtr))
|
||||
|| (rtneEntry->src1 == L2_GetNodeId(instPtr))) {
|
||||
torState = L2_TOR_TX;
|
||||
}
|
||||
else if ((rtneEntry->dst0 == instPtr->myInfo.nodeId)
|
||||
|| (rtneEntry->dst1 == instPtr->myInfo.nodeId)) {
|
||||
else if ((rtneEntry->dst0 == L2_GetNodeId(instPtr))
|
||||
|| (rtneEntry->dst1 == L2_GetNodeId(instPtr))) {
|
||||
torState = L2_TOR_RX;
|
||||
}
|
||||
else {
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
|
||||
// Update RTT FSM if needed.
|
||||
if (L2_GetLastFrameType(instPtr) == L2_INTRA_TSYNC_FRAME && L2_GetLastTor(instPtr) == L2_TOR_RX) {
|
||||
RTT_FsmUpdate(instPtr, L2_TOR_RX);
|
||||
}
|
||||
if (rtneEntry->slotType == SLOT_INTRA_TSYNC && torState == L2_TOR_TX) {
|
||||
RTT_FsmUpdate(instPtr, L2_TOR_TX);
|
||||
}
|
||||
|
||||
switch (rtneEntry->slotType) {
|
||||
case SLOT_INTER_MGMT:
|
||||
// TODO:
|
||||
@@ -895,51 +943,18 @@ int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
break;
|
||||
case SLOT_INTRA_TSYNC:
|
||||
if (torState == L2_TOR_TX) {
|
||||
// TODO:
|
||||
memset(instPtr->sendPktData, 0x00, INTRA_RTT_FRAME_LENGTH_MAX); // FIXME
|
||||
L2_RTT_FSM* rttFsmPtr = L2_GetRttDesc(instPtr);
|
||||
L2_RTT_SATGE rttStage = RTT_GetCurrentStage(rttFsmPtr);
|
||||
if(rttStage == RTT_REQ1 || rttStage == RTT_REQ2){
|
||||
if(rttStage == RTT_REQ1){
|
||||
DBG_INFO("MGMT Sending RTT REQ-1\n");
|
||||
rttData->rttTime.timeH = rttRecord->Tt1.timeH;
|
||||
rttData->rttTime.timeL = rttRecord->Tt1.timeL;
|
||||
rttData->rttDoppler = RTT_DOPPLER_NONE;
|
||||
}
|
||||
else{ //RTT_REQ2
|
||||
DBG_INFO("MGMT Sending RTT REQ-2\n");
|
||||
rttData->rttTime.timeH = (rttFsmPtr->isR2Valid)? rttRecord->TroundA.timeH : RTT_TIME_NONE;
|
||||
rttData->rttTime.timeL = (rttFsmPtr->isR2Valid)? rttRecord->TroundA.timeL : RTT_TIME_NONE;
|
||||
rttData->rttDoppler = (rttFsmPtr->isR2Valid)? rttRecord->dopplerR2:RTT_DOPPLER_NONE;
|
||||
}
|
||||
memset(instPtr->sendPktData, 0xAA, INTRA_RTT_FRAME_LENGTH_MAX);
|
||||
if(L2_GetNodeType(instPtr) == HEAD_NODE){
|
||||
if(MgmtPkt_Packing(instPtr, MGMTPKT_INTRA_RTTREQ) != SUCCESS) {
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
}
|
||||
}
|
||||
else if(rttStage == RTT_RSP1 || rttStage == RTT_RSP2){
|
||||
if(rttStage == RTT_RSP1){
|
||||
DBG_INFO("MGMT Sending RTT RSP-1\n");
|
||||
rttData->rttTime.timeH = (rttFsmPtr->isR1Valid) ? rttRecord->TreplyB.timeH : RTT_TIME_NONE;
|
||||
rttData->rttTime.timeL = (rttFsmPtr->isR1Valid) ? rttRecord->TreplyB.timeL : RTT_TIME_NONE;
|
||||
rttData->rttDoppler = (rttFsmPtr->isR1Valid) ? rttRecord->dopplerR1 : RTT_DOPPLER_NONE;
|
||||
}
|
||||
else{ //RTT_RSP2
|
||||
DBG_INFO("MGMT Sending RTT RSP-2\n");
|
||||
rttData->rttTime.timeH = (rttFsmPtr->isR3Valid) ? rttRecord->TreplyB.timeH : RTT_TIME_NONE;
|
||||
rttData->rttTime.timeL = (rttFsmPtr->isR3Valid) ? rttRecord->TreplyB.timeL : RTT_TIME_NONE;
|
||||
rttData->rttDoppler = (rttFsmPtr->isR3Valid) ? rttRecord->dopplerR3 : RTT_DOPPLER_NONE;
|
||||
}
|
||||
// Packing message.
|
||||
else {
|
||||
if(MgmtPkt_Packing(instPtr, MGMTPKT_INTRA_RTTRSP) != SUCCESS) {
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
DBG_ERROR("Unexpected RTT Stage: %d.\n", rttStage);
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
}
|
||||
L2_SetupNextSlot(instPtr, torState, L2_INTRA_TSYNC_FRAME);
|
||||
@@ -952,7 +967,7 @@ int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
|
||||
/*************************************************/
|
||||
// Update link layer state...
|
||||
if (instPtr->myInfo.nodeType == HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) == HEAD_NODE) {
|
||||
L2_NODE_STATE newState = NONE_STATE;
|
||||
L2_EVENT stateEvent = {
|
||||
.event = L2_EV_MAIN_STATE_UPDATE,
|
||||
@@ -970,7 +985,7 @@ int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
}
|
||||
}
|
||||
else{ // MEMBER_NODE or BACKUP_HEAD
|
||||
if(IsNodeInList(instPtr->nodeList, instPtr->config.headId) == false){
|
||||
if(IsNodeInList(instPtr->nodeList, L2_GetHeadId(instPtr)) == false){
|
||||
L2_NODE_STATE newState = INIT_STATE;
|
||||
L2_EVENT stateEvent = {
|
||||
.event = L2_EV_MAIN_STATE_UPDATE,
|
||||
@@ -982,7 +997,7 @@ int32_t MgmtNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry){
|
||||
.msg = NULL
|
||||
};
|
||||
AssertL2Event(instPtr, &lostCxnEvent);
|
||||
DBG_WARNING("Lost connection with head node [%d].\n", instPtr->config.headId);
|
||||
DBG_WARNING("Lost connection with head node [%d].\n", L2_GetHeadId(instPtr));
|
||||
}
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
@@ -73,8 +73,9 @@ static int32_t Scan_2WAcqHandler(L2_INST* instPtr);
|
||||
static int32_t ScanMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE msgType);
|
||||
static int32_t ScanPkt_Packing(L2_INST* instPtr, SCANPKT_TYPE pktType);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Update Init-Scan lock state.
|
||||
*/
|
||||
static inline void LockStateUpdate(L2_SCAN_FSM* scanFsmPtr, bool state){
|
||||
ASSERT(scanFsmPtr != NULL);
|
||||
DBG_INFO("Update BeamLockState from [%d] to [%d].\n",
|
||||
@@ -82,6 +83,10 @@ static inline void LockStateUpdate(L2_SCAN_FSM* scanFsmPtr, bool state){
|
||||
scanFsmPtr->isLocked = state;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update Base-info Advertisement state.
|
||||
*/
|
||||
static void BmrecvStateUpdate(L2_SCAN_FSM* scanFsmPtr, bool state){
|
||||
ASSERT(scanFsmPtr != NULL);
|
||||
DBG_INFO("Update BmRecvState from [%d] to [%d].\n",
|
||||
@@ -89,6 +94,10 @@ static void BmrecvStateUpdate(L2_SCAN_FSM* scanFsmPtr, bool state){
|
||||
scanFsmPtr->isBmRcved = state;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update 2-Way Acquisition ack state.
|
||||
*/
|
||||
static void W2ackStateUpdate(L2_SCAN_FSM* scanFsmPtr, bool state){
|
||||
ASSERT(scanFsmPtr != NULL);
|
||||
DBG_INFO("Update W2acqAckState from [%d] to [%d].\n",
|
||||
@@ -143,13 +152,11 @@ static int32_t ScanMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, BM_MSG_TYPE_OFFSET, BM_MSG_TYPE_LEN, dataChunk);
|
||||
|
||||
/* source node id */
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t)(instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, BM_MSG_SRC_ADDR_OFFSET, BM_MSG_SRC_ADDR_LEN, dataChunk);
|
||||
|
||||
/* net management node id */
|
||||
dataChunk = (instPtr->config.headId & 0x1F)
|
||||
| (((uint16_t)(instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetHeadId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, BM_MSG_NETMG_ADDR_OFFSET, BM_MSG_NETMG_ADDR_LEN, dataChunk);
|
||||
|
||||
/* time unit number */
|
||||
@@ -218,20 +225,20 @@ static int32_t ScanMsg_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_MSG_TYPE
|
||||
FrameInsertChunk(bitarr, NS_MSG_INI_LEN_OFFSET, NS_MSG_INI_LEN_LEN, dataChunk);
|
||||
|
||||
/* message type */
|
||||
dataChunk = (instPtr->myInfo.nodeId == HEAD_NODE) ? 0 : 1;
|
||||
dataChunk = (L2_GetNodeId(instPtr) == HEAD_NODE) ? 0 : 1;
|
||||
FrameInsertChunk(bitarr, NS_MSG_INI_TYPE_OFFSET, NS_MSG_INI_TYPE_LEN, dataChunk);
|
||||
|
||||
/* source node id */
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)
|
||||
| (((uint16_t)(instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F)
|
||||
| (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, NS_MSG_INI_SRC_ADDR_OFFSET, NS_MSG_INI_SRC_ADDR_LEN, dataChunk);
|
||||
|
||||
/* destination node id */
|
||||
dataChunk = (instPtr->myInfo.nodeId == HEAD_NODE) ?
|
||||
(0x3F | (0x3F << 5)) :
|
||||
(instPtr->config.headId & 0x1F) | (((uint16_t)(instPtr->myInfo.clustId & 0x1F)) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) == HEAD_NODE) ?
|
||||
(BROADCAST_ID | (BROADCAST_ID << 5))
|
||||
: (L2_GetHeadId(instPtr) & 0x1F) | (((uint16_t)(L2_GetClusterId(instPtr) & 0x1F)) << 5);
|
||||
FrameInsertChunk(bitarr, NS_MSG_INI_LEN_OFFSET, NS_MSG_INI_LEN_LEN, dataChunk);
|
||||
if (instPtr->myInfo.nodeType == HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) == HEAD_NODE) {
|
||||
/* current net stage */
|
||||
switch (instPtr->mainState) {
|
||||
case INIT_STATE:
|
||||
@@ -417,30 +424,18 @@ failed:
|
||||
static int32_t Scan_InitScanHandler(L2_INST* instPtr) {
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_SCAN_FSM* scanFsmPtr = instPtr->scanNetFSM;
|
||||
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
||||
static uint32_t scanCnt = 0;
|
||||
DBG_INFO("** Netsetup - InitScan Procedure--**\n");
|
||||
/* clear ack state and lock state in a new scan procedure. */
|
||||
if(scanCnt == 0){
|
||||
LockStateUpdate(scanFsmPtr, false);
|
||||
BmrecvStateUpdate(scanFsmPtr, false);
|
||||
W2ackStateUpdate(scanFsmPtr, false);
|
||||
}
|
||||
if(Phy_IsFrameDetected(phyRef)){
|
||||
LockStateUpdate(scanFsmPtr, true);
|
||||
}
|
||||
DBG_INFO("** Netsetup - InitScan Procedure (Attempts: %u)**\n", scanFsmPtr->scanCnt);
|
||||
|
||||
if(scanFsmPtr->scanMode == INTRA_CLUSTER_MODE){
|
||||
if (scanFsmPtr->isLocked == true) {
|
||||
StageUpdate(scanFsmPtr, BM_ADVT_STAGE);
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_INTRA_BM_FRAME);
|
||||
scanCnt = 0;
|
||||
} /* Otherwise remain INIT_SCAN_STAGE */
|
||||
else {
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_INTRA_SCAN_FRAME);
|
||||
scanCnt++;
|
||||
scanFsmPtr->scanCnt++;
|
||||
}
|
||||
}
|
||||
else if(scanFsmPtr->scanMode == INTER_CLUSTER_MODE){
|
||||
@@ -448,12 +443,11 @@ static int32_t Scan_InitScanHandler(L2_INST* instPtr) {
|
||||
StageUpdate(scanFsmPtr, BM_ADVT_STAGE);
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_INTER_BM_FRAME);
|
||||
scanCnt = 0;
|
||||
} /* Otherwise remain INIT_SCAN_STAGE */
|
||||
else {
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_INTER_SCAN_FRAME);
|
||||
scanCnt++;
|
||||
scanFsmPtr->scanCnt++;
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -476,18 +470,13 @@ static int32_t Scan_InitScanHandler(L2_INST* instPtr) {
|
||||
******************************************************************************/
|
||||
static int32_t Scan_BmAdvtHandler(L2_INST* instPtr) {
|
||||
L2_SCAN_FSM* scanFsmPtr = instPtr->scanNetFSM;
|
||||
DBG_INFO("** Netsetup - BmAdvt Procedure--**\n");
|
||||
DBG_INFO("BM Timeout: %u.\n", scanFsmPtr->bmTimeout);
|
||||
DBG_INFO("** Netsetup - BmAdvt Procedure (Timeout: %u) **\n", scanFsmPtr->bmTimeout);
|
||||
|
||||
// if received a valid bm frame.
|
||||
if (scanFsmPtr->isBmRcved == true) {
|
||||
scanFsmPtr->bmTimeout = 0; /* reset listen counter. */
|
||||
/* First BM Advt Frame. */
|
||||
DBG_INFO("Received Bm frame.\n");
|
||||
DBG_INFO("Skipping 10ms for turn around.\n");
|
||||
/* Antenna setting (reserved.) */
|
||||
// FIXME: SUSPEND how many slots in inter net setup mode?
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_SUSPEND, L2_INTRA_W2_ACQ_FRAME);
|
||||
DBG_INFO("Received Bm frame, skipping 10ms for turn around...\n");
|
||||
// TODO: check functionality.
|
||||
StageUpdate(scanFsmPtr, WAY2_ACQ_STAGE);
|
||||
return NUM_SLOTS_10MS;
|
||||
}
|
||||
@@ -507,8 +496,9 @@ static int32_t Scan_BmAdvtHandler(L2_INST* instPtr) {
|
||||
DBG_ERROR("UNKNOWN Scan Mode: %d.\n", scanFsmPtr->scanMode);
|
||||
return NUM_SLOTS_NONE;
|
||||
}
|
||||
StageUpdate(scanFsmPtr, INIT_SCAN_STAGE);
|
||||
DBG_WARNING("BM timeout, restart net scan from INIT_SCAN_STAGE.\n");
|
||||
scanFsmPtr->bmTimeout = 0; /* reset listen counter. */
|
||||
StageUpdate(scanFsmPtr, INIT_SCAN_STAGE);
|
||||
}
|
||||
else {
|
||||
if(scanFsmPtr->scanMode == INTRA_CLUSTER_MODE){
|
||||
@@ -540,8 +530,7 @@ static int32_t Scan_BmAdvtHandler(L2_INST* instPtr) {
|
||||
******************************************************************************/
|
||||
static int32_t Scan_2WAcqHandler (L2_INST* instPtr){
|
||||
L2_SCAN_FSM* scanFsmPtr = instPtr->scanNetFSM;
|
||||
DBG_INFO("** Netsetup - 2WAcq Procedure--**\n");
|
||||
DBG_INFO("2WAcq Timeout: %u.\n", scanFsmPtr->w2acqTimeout);
|
||||
DBG_INFO("** Netsetup - 2WAcq Procedure (Timeout: %u) **\n", scanFsmPtr->w2acqTimeout);
|
||||
L2_FRAME_TYPE frameType = L2_NONE_FRAME;
|
||||
|
||||
if(scanFsmPtr->scanMode == INTRA_CLUSTER_MODE){
|
||||
@@ -557,6 +546,7 @@ static int32_t Scan_2WAcqHandler (L2_INST* instPtr){
|
||||
|
||||
// 2 way acq failed, back to init stage.
|
||||
if (scanFsmPtr->w2acqTimeout >= WAY2_ACQ_SLOT_MAX) {
|
||||
DBG_WARNING("2WAcq timeout, restart net scan from INIT_SCAN_STAGE.\n");
|
||||
scanFsmPtr->w2acqTimeout = 0; // reset counter for next scan.
|
||||
StageUpdate(scanFsmPtr, INIT_SCAN_STAGE);
|
||||
}
|
||||
@@ -588,7 +578,7 @@ int32_t ScanNet_PktHandler(L2_INST* instPtr) {
|
||||
free(scanMsg);
|
||||
return EALLOC;
|
||||
}
|
||||
switch (L2_GetLastRcvFrameType(instPtr)) {
|
||||
switch (L2_GetLastFrameType(instPtr)) {
|
||||
case L2_INTER_SCAN_FRAME:
|
||||
case L2_INTRA_SCAN_FRAME:
|
||||
// refer to "linklayer814.c/L2_FrameStateUpdate"
|
||||
@@ -641,7 +631,7 @@ int32_t ScanNet_PktHandler(L2_INST* instPtr) {
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE){
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE){
|
||||
if (IsNodeInList(instPtr->nodeList, scanFsmPtr->BMrcvLog.NodeId) == false) {
|
||||
AppendNode(instPtr->nodeList, scanFsmPtr->BMrcvLog.NodeId, (uint8_t) MEMBER_NODE);
|
||||
}
|
||||
@@ -655,7 +645,7 @@ int32_t ScanNet_PktHandler(L2_INST* instPtr) {
|
||||
BmrecvStateUpdate(scanFsmPtr, true);
|
||||
}
|
||||
else{
|
||||
DBG_ERROR("Node type [%d] is not supposed to receive BM frame", instPtr->myInfo.nodeType);
|
||||
DBG_ERROR("Node type [%d] is not supposed to receive BM frame", L2_GetNodeType(instPtr));
|
||||
Status = EUNEXP;
|
||||
goto failed;
|
||||
}
|
||||
@@ -731,18 +721,18 @@ int32_t ScanNet_PktHandler(L2_INST* instPtr) {
|
||||
}
|
||||
}
|
||||
// Update net start time
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE){
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE){
|
||||
instPtr->netStartTime = scanFsmPtr->W2ACQrcvLog.NetScanTime;
|
||||
}
|
||||
|
||||
if(instPtr->myInfo.nodeType == HEAD_NODE){
|
||||
if(L2_GetNodeType(instPtr) == HEAD_NODE){
|
||||
if (IsNodeInList(instPtr->nodeList, scanFsmPtr->W2ACQrcvLog.NodeId) == false) {
|
||||
AppendNode(instPtr->nodeList, scanFsmPtr->W2ACQrcvLog.NodeId, (uint8_t) MEMBER_NODE);
|
||||
}
|
||||
// TODO: Update Node Info
|
||||
}
|
||||
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE && scanFsmPtr->W2ACQrcvLog.NetStage != NONE_STATE){
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE && scanFsmPtr->W2ACQrcvLog.NetStage != NONE_STATE){
|
||||
// sync state with head node
|
||||
L2_NODE_STATE newState = scanFsmPtr->W2ACQrcvLog.NetStage;
|
||||
L2_EVENT stateUpEvent = {
|
||||
@@ -778,8 +768,7 @@ int32_t ScanNet_PktHandler(L2_INST* instPtr) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
DBG_ERROR("Cannot handler message type [%d] properly.\n",
|
||||
L2_GetLastRcvFrameType(instPtr));
|
||||
DBG_ERROR("Cannot handler message type [%d] properly.\n", L2_GetLastFrameType(instPtr));
|
||||
Status = EIGNORE;
|
||||
goto failed;
|
||||
}
|
||||
@@ -826,6 +815,9 @@ void ScanNet_Reset(L2_SCAN_FSM* scanFSMPtr) {
|
||||
scanFSMPtr->isLocked = false;
|
||||
scanFSMPtr->isBmRcved = false;
|
||||
scanFSMPtr->isAcked = false;
|
||||
scanFSMPtr->scanCnt = 0;
|
||||
scanFSMPtr->bmTimeout = 0;
|
||||
scanFSMPtr->w2acqTimeout = 0;
|
||||
scanFSMPtr->scanStage = NONE_STAGE;
|
||||
scanFSMPtr->scanMode = INTRA_CLUSTER_MODE;
|
||||
// FIXME: Only for test
|
||||
@@ -871,7 +863,7 @@ void ScanNet_Destroy(L2_SCAN_FSM* scanFSMPtr) {
|
||||
******************************************************************************/
|
||||
int32_t ScanNet_Proc(L2_INST* instPtr) {
|
||||
L2_SCAN_FSM* scanFsmPtr = instPtr->scanNetFSM;
|
||||
if (instPtr->myInfo.nodeType == HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) == HEAD_NODE) {
|
||||
DBG_ERROR("Only member node needs to execute ScanNet_Proc. \n");
|
||||
return NUM_SLOTS_NONE;
|
||||
}
|
||||
@@ -921,11 +913,11 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
return SQUENCE_SCAN_SLOTS;
|
||||
}
|
||||
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE){
|
||||
if (rtneEntry->dst0 == instPtr->myInfo.nodeId || rtneEntry->dst0 == BROADCAST_ID){
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE){
|
||||
if (rtneEntry->dst0 == L2_GetNodeId(instPtr) || rtneEntry->dst0 == BROADCAST_ID){
|
||||
torState = L2_TOR_RX;
|
||||
}
|
||||
else if (rtneEntry->src0 == instPtr->myInfo.nodeId || rtneEntry->src0 == BROADCAST_ID){
|
||||
else if (rtneEntry->src0 == L2_GetNodeId(instPtr) || rtneEntry->src0 == BROADCAST_ID){
|
||||
torState = L2_TOR_TX;
|
||||
}
|
||||
else {
|
||||
@@ -933,10 +925,10 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (rtneEntry->dst0 == instPtr->myInfo.nodeId){
|
||||
if (rtneEntry->dst0 == L2_GetNodeId(instPtr)){
|
||||
torState = L2_TOR_RX;
|
||||
}
|
||||
else if (rtneEntry->src0 == instPtr->myInfo.nodeId){
|
||||
else if (rtneEntry->src0 == L2_GetNodeId(instPtr)){
|
||||
torState = L2_TOR_TX;
|
||||
}
|
||||
else {
|
||||
@@ -951,7 +943,7 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
break;
|
||||
|
||||
case SLOT_INTRA_SCAN_ACQ:
|
||||
if (instPtr->myInfo.nodeType != HEAD_NODE && torState == L2_TOR_TX) {
|
||||
if (L2_GetNodeType(instPtr) != HEAD_NODE && torState == L2_TOR_TX) {
|
||||
DBG_ERROR("Only head node can send init-scan Frame.\n");
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
@@ -966,7 +958,7 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
|
||||
case SLOT_INTRA_SCAN_BM:
|
||||
if (torState == L2_TOR_TX) {
|
||||
if (instPtr->myInfo.nodeType != HEAD_NODE) {
|
||||
if (L2_GetNodeType(instPtr) != HEAD_NODE) {
|
||||
DBG_ERROR("Only head node can send BM Frame.\n");
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
@@ -982,12 +974,11 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
break;
|
||||
case SLOT_INTER_SCAN_2W:
|
||||
// TODO:
|
||||
DBG_INFO("#Routine# [Inter Scan-W2_ACQ SUSPEND].\n");
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_SUSPEND, L2_INTER_W2_ACQ_FRAME);
|
||||
break;
|
||||
case SLOT_INTRA_SCAN_2W:
|
||||
if (torState == L2_TOR_TX) {
|
||||
if(instPtr->myInfo.nodeType != HEAD_NODE && L2_isDataAvail(instPtr) == false) {
|
||||
if(L2_GetNodeType(instPtr) != HEAD_NODE && L2_isDataAvail(instPtr) == false) {
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_SUSPEND, L2_INTRA_W2_ACQ_FRAME);
|
||||
break;
|
||||
@@ -999,6 +990,7 @@ int32_t ScanNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntry)
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
}
|
||||
W2ackStateUpdate(instPtr->scanNetFSM, true);
|
||||
acqSend ++;
|
||||
}
|
||||
/* Antenna setting (reserved.) */
|
||||
|
||||
@@ -76,10 +76,10 @@ static int UduHeader_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, uint8_t dst, u
|
||||
dataChunk = dataLen;
|
||||
FrameInsertChunk(bitarr, UDUH_LENGTH_OFFSET, UDUH_LENGTH_LEN, dataChunk);
|
||||
// source node id
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, UDUH_SRC_ADDR_OFFSET, UDUH_SRC_ADDR_LEN, dataChunk);
|
||||
// destination node id
|
||||
dataChunk = (dst & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (dst & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, UDUH_DST_ADDR_OFFSET, UDUH_DST_ADDR_LEN, dataChunk);
|
||||
// UDU Sequence number
|
||||
dataChunk = 0;
|
||||
@@ -126,10 +126,10 @@ static int PduHeader_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_PDU_HEADER_
|
||||
dataChunk = INTRA_SVC_FRAME_LENGTH_MAX;
|
||||
FrameInsertChunk(bitarr, PDUH0_LENGTH_OFFSET, PDUH0_LENGTH_LEN, dataChunk);
|
||||
// source node id
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, PDUH0_SRC_ADDR_OFFSET, PDUH0_SRC_ADDR_LEN, dataChunk);
|
||||
// destination node id
|
||||
dataChunk = (dst & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (dst & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, PDUH0_DST_ADDR_OFFSET, PDUH0_DST_ADDR_LEN, dataChunk);
|
||||
// Sequence number
|
||||
dataChunk = 0;
|
||||
@@ -149,10 +149,10 @@ static int PduHeader_Packing(L2_INST* instPtr, BIT_ARRAY* bitarr, L2_PDU_HEADER_
|
||||
dataChunk = INTRA_SVC_FRAME_LENGTH_MAX;
|
||||
FrameInsertChunk(bitarr, PDUH1_LENGTH_OFFSET, PDUH1_LENGTH_LEN, dataChunk);
|
||||
// source node id
|
||||
dataChunk = (instPtr->myInfo.nodeId & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (L2_GetNodeId(instPtr) & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, PDUH1_SRC_ADDR_OFFSET, PDUH1_SRC_ADDR_LEN, dataChunk);
|
||||
// destination node id
|
||||
dataChunk = (dst & 0x1F)|((instPtr->myInfo.clustId & 0x1F) << 5);
|
||||
dataChunk = (dst & 0x1F)|((L2_GetClusterId(instPtr) & 0x1F) << 5);
|
||||
FrameInsertChunk(bitarr, PDUH1_DST_ADDR_OFFSET, PDUH1_DST_ADDR_LEN, dataChunk);
|
||||
// Slice tage...
|
||||
// Append CRC
|
||||
@@ -229,10 +229,10 @@ int32_t ServiceNet_Routine(L2_INST* instPtr, const L2_RTNE_TABLE_ENTRY* rtneEntr
|
||||
}
|
||||
|
||||
// Determine TOR State.
|
||||
if(rtneEntry->src0 == instPtr->myInfo.nodeId){
|
||||
if(rtneEntry->src0 == L2_GetNodeId(instPtr)){
|
||||
torState = L2_TOR_TX;
|
||||
}
|
||||
else if(rtneEntry->dst0 == instPtr->myInfo.nodeId){
|
||||
else if(rtneEntry->dst0 == L2_GetNodeId(instPtr)){
|
||||
torState = L2_TOR_RX;
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -22,51 +22,30 @@
|
||||
#include <stdint.h>
|
||||
#include "linklayer814.h"
|
||||
#include "linklayer814_types.h"
|
||||
#include "../time_ctrl/time_ctrl.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
#define MAX_FREQ_EST_NUM 128 // 32bit word
|
||||
#define SVC_FREQ_EST_NUM 512 // byte
|
||||
#define MGMT_FREQ_EST_NUM 512 // byte
|
||||
#define BISAR_FREQ_EST_NUM 480 // byte
|
||||
|
||||
#define CXR_FREQ 3800000000.0 // Hz
|
||||
|
||||
#define LIGHT_SPPED_AIR 299702547.0 // m/s
|
||||
#define LIGHT_SPPED_VAC 299792458.0 // m/s
|
||||
|
||||
#define RCV2FSYNC_CLOCKS 0 // clocks from frame sync time to receive time
|
||||
#define PHYRSP_DELAY_CLOCKS 0// clocks from frame sync time to receive time
|
||||
//#define PHY_SYNCT2FEND_200K 904052L
|
||||
//#define PHY_SYNCT2FEND_200K 924232L
|
||||
#define PHY_SYNCT2FEND_200K 905052L
|
||||
|
||||
#define RTT_TIME_NONE UINT32_MAX
|
||||
#define RTT_DOPPLER_NONE UINT32_MAX
|
||||
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
// TODO: Multi-node RTT
|
||||
typedef struct {
|
||||
L2_TIME_WORD Tt1;
|
||||
L2_TIME_WORD Tr1;
|
||||
L2_TIME_WORD Tt2;
|
||||
L2_TIME_WORD Tr2;
|
||||
L2_TIME_WORD Tt3;
|
||||
L2_TIME_WORD Tr3;
|
||||
L2_TIME_WORD Tt4;
|
||||
L2_TIME_WORD Tr4;
|
||||
TIME_WORD Tt1;
|
||||
TIME_WORD Tr1;
|
||||
TIME_WORD Tt2;
|
||||
TIME_WORD Tr2;
|
||||
TIME_WORD Tt3;
|
||||
TIME_WORD Tr3;
|
||||
TIME_WORD Tt4;
|
||||
TIME_WORD Tr4;
|
||||
int32_t dopplerR1;
|
||||
int32_t dopplerR2;
|
||||
int32_t dopplerR3;
|
||||
int32_t dopplerR4;
|
||||
L2_TIME_WORD TroundA;
|
||||
L2_TIME_WORD TreplyA;
|
||||
L2_TIME_WORD TroundB;
|
||||
L2_TIME_WORD TreplyB;
|
||||
int32_t rttAdj;
|
||||
TIME_WORD TroundA;
|
||||
TIME_WORD TreplyA;
|
||||
TIME_WORD TroundB;
|
||||
TIME_WORD TreplyB;
|
||||
} RTT_RECORD;
|
||||
|
||||
typedef enum {
|
||||
@@ -78,25 +57,15 @@ typedef enum {
|
||||
} L2_RTT_SATGE;
|
||||
|
||||
typedef struct {
|
||||
L2_RCD rttStatge;
|
||||
L2_RTT_SATGE rttStatge;
|
||||
bool isR1Valid;
|
||||
bool isR2Valid;
|
||||
bool isR3Valid;
|
||||
bool isR4Valid;
|
||||
RTT_RECORD rttRecord;
|
||||
TIME_WORD timeStamp;
|
||||
uint32_t doppler;
|
||||
} L2_RTT_FSM;
|
||||
|
||||
typedef enum {
|
||||
RTT_NONE = 0,
|
||||
RTT_SEND = 1,
|
||||
RTT_RCV = 2,
|
||||
} L2_RTT_TOR;
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
// RTT
|
||||
L2_RTT_SATGE RTT_GetLastStage(L2_RTT_FSM* rttFsmPtr);
|
||||
L2_RTT_SATGE RTT_GetCurrentStage(L2_RTT_FSM* rttFsmPtr);
|
||||
L2_RTT_SATGE RTT_GetNextStage(L2_RTT_FSM* rttFsmPtr);
|
||||
|
||||
#endif /* RTT_H_ */
|
||||
|
||||
@@ -26,14 +26,22 @@
|
||||
#include "../common.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
#define LIGHT_SPPED_AIR 299702547.0 // m/s
|
||||
#define LIGHT_SPPED_VAC 299792458.0 // m/s
|
||||
#define RTT_DOPPLER_NONE UINT32_MAX
|
||||
|
||||
const TIME_WORD RTT_TIME_NONE = {
|
||||
.int_part = UINT32_MAX,
|
||||
.frac_part = UINT32_MAX
|
||||
};
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
/**************************** Type Definitions *******************************/
|
||||
/************************** Variable Definitions *****************************/
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
static void RTT_StageUpdate(L2_RTT_FSM* rttFsmPtr, L2_RTT_SATGE newSatge);
|
||||
static void RTT_ResetRecord(RTT_RECORD* recordPtr);
|
||||
static int32_t RTT_GetCounter10nsDeviation(PHY_INST *phyRef);
|
||||
static void RTT_GetFrameStart(L2_INST* instPtr, TIME_WORD *tmStamp, L2_TOR_TYPE torType);
|
||||
void RTT_CalculateTimeGap(const TIME_WORD *tmA, const TIME_WORD *tmB, TIME_WORD *tRound);
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -70,48 +78,18 @@ int32_t L2_TimeAlign(L2_INST* instPtr, uint32_t frameNum, uint32_t slotNum){
|
||||
|
||||
timeDiff = (int64_t)(expctTime - currTime);
|
||||
|
||||
slotTimerAdjmet.int_part = (uint32_t)(timeDiff/COUNTE_FRAC_MAX);
|
||||
slotTimerAdjmet.frac_part = (uint32_t)(timeDiff%COUNTE_FRAC_MAX);
|
||||
slotTimerAdjmet.int_part = (uint32_t)(timeDiff / COUNTE_FRAC_MAX);
|
||||
slotTimerAdjmet.frac_part = (uint32_t)(timeDiff % COUNTE_FRAC_MAX);
|
||||
TimeCtrl_TimeAdjust(instPtr->config.tmcInstPtr, &slotTimerAdjmet, TM_ADJ_ADD);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get last RTT stage of a specified RTT descriptor.
|
||||
*/
|
||||
inline L2_RTT_SATGE RTT_GetLastStage(L2_RTT_FSM* rttFsmPtr){
|
||||
ASSERT(rttFsmPtr != NULL);
|
||||
return rttFsmPtr->rttStatge.last;
|
||||
}
|
||||
/**
|
||||
* @brief Get current RTT stage of a specified RTT descriptor.
|
||||
*/
|
||||
inline L2_RTT_SATGE RTT_GetCurrentStage(L2_RTT_FSM* rttFsmPtr){
|
||||
ASSERT(rttFsmPtr != NULL);
|
||||
return rttFsmPtr->rttStatge.curr;
|
||||
}
|
||||
/**
|
||||
* @brief Get next RTT stage of a specified RTT descriptor.
|
||||
*/
|
||||
inline L2_RTT_SATGE RTT_GetNextStage(L2_RTT_FSM* rttFsmPtr){
|
||||
ASSERT(rttFsmPtr != NULL);
|
||||
return rttFsmPtr->rttStatge.next;
|
||||
}
|
||||
/**
|
||||
* @brief Get next RTT stage of a specified RTT descriptor.
|
||||
*/
|
||||
static inline void RTT_ResetRecord(RTT_RECORD* recordPtr){
|
||||
ASSERT(recordPtr != NULL);
|
||||
memset(recordPtr, 0x00, sizeof(RTT_RECORD));
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Update corrent time-sync for RTT stage
|
||||
*
|
||||
* @param scanFsmPtr A pointer to scan net fsm.
|
||||
* newSatge New state.
|
||||
* @param newSatge New state.
|
||||
*
|
||||
* @return NONE.
|
||||
*
|
||||
@@ -119,49 +97,114 @@ static inline void RTT_ResetRecord(RTT_RECORD* recordPtr){
|
||||
static void RTT_StageUpdate(L2_RTT_FSM* rttFsmPtr, L2_RTT_SATGE newSatge) {
|
||||
ASSERT(rttFsmPtr != NULL);
|
||||
ASSERT(newSatge >= RTT_NONE_STAGE && newSatge <= RTT_RSP2);
|
||||
DBG_INFO("RTT current Stage: %u -> RTT new Stage: %u, Stage: arranged.%d.\n",
|
||||
rttFsmPtr->rttStatge.curr, rttFsmPtr->rttStatge.next, newSatge);
|
||||
L2_RcdShift(&(rttFsmPtr->rttStatge), newSatge);
|
||||
return;
|
||||
DBG_INFO("RTT Stage Update: %d -> %d.\n", rttFsmPtr->rttStatge, newSatge);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Reset RTT systerm .
|
||||
* @brief Reset RTT FSM
|
||||
*
|
||||
* @param rttFsmPtr
|
||||
* @param rttFsmPtr a pointer to rtt FSM instance.
|
||||
*
|
||||
* @return SUCCESS Initialization successful.
|
||||
* EMAC_MEMORY_ALLOC_ERROR Memory allocate error.
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void RTT_Reset(L2_RTT_FSM* rttFsmPtr){
|
||||
ASSERT(rttFsmPtr != NULL);
|
||||
RTT_ResetRecord(&(rttFsmPtr->rttRecord));
|
||||
rttFsmPtr->rttStatge.last = RTT_NONE_STAGE;
|
||||
rttFsmPtr->rttStatge.curr = RTT_NONE_STAGE;
|
||||
rttFsmPtr->rttStatge.next = RTT_NONE_STAGE;
|
||||
memset(&(rttFsmPtr->rttRecord), 0x00, sizeof(RTT_RECORD));
|
||||
rttFsmPtr->rttStatge = RTT_NONE_STAGE;
|
||||
rttFsmPtr->isR1Valid = false;
|
||||
rttFsmPtr->isR2Valid = false;
|
||||
rttFsmPtr->isR3Valid = false;
|
||||
rttFsmPtr->isR4Valid = false;
|
||||
rttFsmPtr->timeStamp.int_part = 0;
|
||||
rttFsmPtr->timeStamp.frac_part = 0;
|
||||
rttFsmPtr->doppler = 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Destroy RTT FSM, free allocated memory.
|
||||
*
|
||||
* @param rttFsmPtr a pointer to rtt FSM instance.
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void RTT_Destroy(L2_RTT_FSM* rttFsmPtr){
|
||||
free(rttFsmPtr);
|
||||
}
|
||||
|
||||
|
||||
static int32_t RTT_GetCounter10nsDeviation(PHY_INST *phyRef) {
|
||||
TIME_WORD timeStamp;
|
||||
int64_t lastFrameSyncT, lastSlotStartT;
|
||||
Phy_GetFrameSyncTimeStamp(phyRef, &timeStamp);
|
||||
lastFrameSyncT = (uint64_t) timeStamp.frac_part;
|
||||
lastFrameSyncT += ((uint64_t)timeStamp.int_part) * COUNTE_FRAC_MAX;
|
||||
Phy_GetLastSlotStartTimeStamp(phyRef, &timeStamp);
|
||||
lastSlotStartT = (uint64_t) timeStamp.frac_part;
|
||||
lastSlotStartT += ((uint64_t)timeStamp.int_part) * COUNTE_FRAC_MAX;
|
||||
return (PHY_SYNCT2FEND_200K - (lastSlotStartT - lastFrameSyncT));
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Get the frame start time. If torType == L2_TOR_TX, get the next
|
||||
* slot start time, if torType == L2_TOR_RX get last frame start
|
||||
* time.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer layer instance
|
||||
* @param tmStamp a pointer to store frame start time
|
||||
* @param torType tx/rx mode
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void RTT_GetFrameStart(L2_INST* instPtr, TIME_WORD *tmStamp, L2_TOR_TYPE torType){
|
||||
ASSERT(instPtr != NULL);
|
||||
ASSERT(tmStamp != NULL);
|
||||
// Get the next frame start time
|
||||
if(torType == L2_TOR_TX) {
|
||||
tmStamp->int_part = L2_GetNextFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetNextSlotNum(instPtr);
|
||||
tmStamp->frac_part = 0 ;
|
||||
}
|
||||
// Get the last reiceive frame start time
|
||||
else if(torType == L2_TOR_RX) {
|
||||
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
||||
TIME_WORD timeStamp;
|
||||
int64_t timeDiff;
|
||||
Phy_GetFrameSyncTimeStamp(phyRef, &timeStamp);
|
||||
timeDiff = (uint64_t) timeStamp.frac_part;
|
||||
timeDiff += ((uint64_t)timeStamp.int_part) * COUNTE_FRAC_MAX;
|
||||
Phy_GetLastSlotStartTimeStamp(phyRef, tmStamp);
|
||||
timeDiff -= ((uint64_t) tmStamp->int_part) * COUNTE_FRAC_MAX;
|
||||
timeDiff -= (uint64_t) tmStamp->frac_part;
|
||||
timeDiff = (int64_t)Phy_GetTimeComp(L2_L2frame2L1frame(L2_GetLastFrameType(instPtr))) - timeDiff;
|
||||
if (timeDiff < 0) {
|
||||
timeDiff += COUNTE_FRAC_MAX;
|
||||
tmStamp->int_part--;
|
||||
_nop_();
|
||||
}
|
||||
tmStamp->frac_part = (TIME_FRAC)timeDiff;
|
||||
}
|
||||
else {
|
||||
*tmStamp = RTT_TIME_NONE;
|
||||
DBG_ERROR("Unexpected tx/rx mode, setting dummy values.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Calculate tmA - tmA.
|
||||
*
|
||||
* @param tmA time stamp A
|
||||
* @param tmA time stamp B
|
||||
* @param tRound t round
|
||||
*
|
||||
* @return NONE
|
||||
*
|
||||
******************************************************************************/
|
||||
void RTT_CalculateTimeGap(const TIME_WORD *tmA, const TIME_WORD *tmB, TIME_WORD *tRound){
|
||||
ASSERT(tmA != NULL);
|
||||
ASSERT(tmB != NULL);
|
||||
ASSERT(tRound != NULL);
|
||||
uint64_t timeDiff;
|
||||
timeDiff = (uint64_t) tmB->frac_part;
|
||||
timeDiff += ((uint64_t)tmB->int_part) * COUNTE_FRAC_MAX;
|
||||
timeDiff -= ((uint64_t)tmA->int_part) * COUNTE_FRAC_MAX;
|
||||
timeDiff -= (uint64_t) tmA->frac_part;
|
||||
tRound->frac_part = (TIME_FRAC)(timeDiff % COUNTE_FRAC_MAX);
|
||||
tRound->frac_part = (TIME_INT)(timeDiff / COUNTE_FRAC_MAX);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -186,338 +229,266 @@ int32_t RTT_Init(L2_RTT_FSM** rttFsmPtr){
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Execute a Time-Sync Process.
|
||||
* @brief Update RTT FSM accordingly.
|
||||
*
|
||||
* @param instPtr a pointer to linklayer layer instance
|
||||
* @param torType tx/rx mode type
|
||||
*
|
||||
* @return SUCCESS Time-Sync Process Done.
|
||||
* FAILURE Time-Sync Process end with error.
|
||||
* @return SUCCESS
|
||||
* error code
|
||||
*
|
||||
******************************************************************************/
|
||||
int32_t RTT_Proc(L2_INST* instPtr) {
|
||||
int32_t RTT_FsmUpdate(L2_INST* instPtr, L2_TOR_TYPE torType) {
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_RTT_FSM* rttFsmPtr = L2_GetRttDesc(instPtr);
|
||||
L2_RTT_FSM* rttFsmPtr = L2_GetRttFsm(instPtr);
|
||||
RTT_RECORD* rttRecord = &(rttFsmPtr->rttRecord);
|
||||
PHY_INST *phyRef = instPtr->config.phyInstPtr;
|
||||
int32_t Status = SUCCESS;
|
||||
L2_RTT_TOR lastTor, nextTor;
|
||||
if(instPtr->rtneConfig.last != NULL && instPtr->rtneConfig.last->slotType == SLOT_INTRA_TSYNC){
|
||||
// Get last tor state
|
||||
if(instPtr->rtneConfig.last->src0 == instPtr->myInfo.nodeId){
|
||||
lastTor = RTT_SEND;
|
||||
}
|
||||
else if(instPtr->rtneConfig.last->dst0 == instPtr->myInfo.nodeId){
|
||||
lastTor = RTT_RCV;
|
||||
}
|
||||
else{
|
||||
lastTor = RTT_NONE;
|
||||
}
|
||||
}
|
||||
else{
|
||||
lastTor = RTT_NONE;
|
||||
}
|
||||
|
||||
if(instPtr->rtneConfig.next != NULL && instPtr->rtneConfig.next->slotType == SLOT_INTRA_TSYNC){
|
||||
// Get next tor state
|
||||
if(instPtr->rtneConfig.next->src0 == instPtr->myInfo.nodeId){
|
||||
nextTor = RTT_SEND;
|
||||
}
|
||||
else if(instPtr->rtneConfig.next->dst0 == instPtr->myInfo.nodeId){
|
||||
nextTor = RTT_RCV;
|
||||
}
|
||||
else{
|
||||
nextTor = RTT_NONE;
|
||||
}
|
||||
}
|
||||
else{
|
||||
nextTor = RTT_NONE;
|
||||
}
|
||||
|
||||
DBG_INFO("-------- RTT Procedure --------\n");
|
||||
DBG_INFO("-------- RTT FSM Update --------\n");
|
||||
// Stage trans
|
||||
// For Head Node: Tx->Rx->Tx->Rx
|
||||
if(instPtr->myInfo.nodeType == HEAD_NODE){
|
||||
switch(rttFsmPtr->rttStatge.next) {
|
||||
case RTT_NONE_STAGE :
|
||||
DBG_INFO("RTT procedure start...\n");
|
||||
// TODO
|
||||
// RTT_ResetRecord(rttRecord);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_REQ1);
|
||||
break;
|
||||
if(L2_GetNodeType(instPtr) == HEAD_NODE){
|
||||
switch(rttFsmPtr->rttStatge) {
|
||||
case RTT_REQ1 :
|
||||
if(nextTor == RTT_SEND){
|
||||
if(torType == L2_TOR_TX){
|
||||
DBG_INFO("Prepare data for RTT REQ-1\n");
|
||||
rttRecord->Tt1.timeH = L2_GetNextFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetNextSlotNum(instPtr);
|
||||
rttRecord->Tt1.timeL = 0 ;
|
||||
DBG_INFO("Tt1-timeL:%u.\n", rttRecord->Tt1.timeL);
|
||||
DBG_INFO("Tt1-timeH:%u.\n", rttRecord->Tt1.timeH);
|
||||
// Update Tt1
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tt1), torType);
|
||||
DBG_INFO("Tt1-timeL:%u.\n", rttRecord->Tt1.int_part);
|
||||
DBG_INFO("Tt1-timeH:%u.\n", rttRecord->Tt1.frac_part);
|
||||
|
||||
// Prepare data for sending...
|
||||
rttFsmPtr->timeStamp = rttRecord->Tt1;
|
||||
rttFsmPtr->doppler = RTT_DOPPLER_NONE;
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_RSP1);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("Skip RTT slot, [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_RSP1 :
|
||||
if(lastTor == RTT_RCV){
|
||||
if(torType == L2_TOR_RX){
|
||||
if(L2_isDataAvail(instPtr) == true){
|
||||
DBG_INFO("RTT RSP-1 have been received.\n");
|
||||
DBG_INFO("Preparing data for RTT REQ-2.\n");
|
||||
rttFsmPtr->isR2Valid = true;
|
||||
// Calculate doppler
|
||||
double doppler = Phy_GetCoarseFreqEst(phyRef);
|
||||
rttRecord->dopplerR2 = (int32_t)doppler;
|
||||
DBG_INFO("rttRecord->dopplerR2: %u.\n", rttRecord->dopplerR2);
|
||||
|
||||
// Calculate last frame receive time.
|
||||
int32_t counter10ns = RTT_GetCounter10nsDeviation(phyRef);
|
||||
// response for rtt Adj
|
||||
counter10ns += 10000;
|
||||
counter10ns -= rttRecord->rttAdj;
|
||||
if ( counter10ns < 0) {
|
||||
counter10ns += COUNTE_FRAC_MAX;
|
||||
rttRecord->Tr2.timeH -- ;
|
||||
_nop_();
|
||||
}
|
||||
rttRecord->Tr2.timeH = L2_GetLastFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetLastSlotNum(instPtr);
|
||||
rttRecord->Tr2.timeL = (uint32_t)counter10ns;
|
||||
DBG_INFO("Tr2-timeL:%u.\n", rttRecord->Tr2.timeL);
|
||||
DBG_INFO("Tr2-timeH:%u.\n", rttRecord->Tr2.timeH);
|
||||
|
||||
// Update doppler
|
||||
rttRecord->dopplerR2 = (int32_t)Phy_GetCoarseFreqEst(phyRef);
|
||||
// Update Tr2
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tr2), torType);
|
||||
// Calculate TroundA
|
||||
rttRecord->TroundA.timeL = rttRecord->Tr2.timeL;
|
||||
rttRecord->TroundA.timeH = rttRecord->Tr2.timeH - rttRecord->Tt1.timeH;
|
||||
DBG_INFO("TroundA-timeL:%u.\n", rttRecord->TroundA.timeL);
|
||||
DBG_INFO("TroundA-timeH:%u.\n", rttRecord->TroundA.timeH);
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tt1), &(rttRecord->Tr2), &(rttRecord->TroundA));
|
||||
}
|
||||
else{
|
||||
rttFsmPtr->isR2Valid = false;
|
||||
rttRecord->dopplerR2 = RTT_DOPPLER_NONE;
|
||||
rttRecord->TroundA.timeL = RTT_TIME_NONE;
|
||||
rttRecord->TroundA.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-1 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_WARNING("Set dopplerR2 and TroundA to dummy value.\n");
|
||||
DBG_INFO("dopplerR2:%08X.\n", rttRecord->dopplerR2);
|
||||
DBG_INFO("TroundA-timeL:%08X.\n", rttRecord->TroundA.timeL);
|
||||
DBG_INFO("TroundA-timeH:%08X.\n", rttRecord->TroundA.timeH);
|
||||
rttRecord->Tr2 = RTT_TIME_NONE;
|
||||
rttRecord->TroundA = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-1 had not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set Tr2 dopplerR2 and TroundA to dummy value.\n");
|
||||
}
|
||||
DBG_INFO("dopplerR2:%08X.\n", rttRecord->dopplerR2);
|
||||
DBG_INFO("Tr2-timeL:%u.\n", rttRecord->Tr2.frac_part);
|
||||
DBG_INFO("Tr2-timeH:%u.\n", rttRecord->Tr2.int_part);
|
||||
DBG_INFO("TroundA-timeL:%08X.\n", rttRecord->TroundA.frac_part);
|
||||
DBG_INFO("TroundA-timeH:%08X.\n", rttRecord->TroundA.int_part);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_REQ2);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("Skip RTT slot, [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_REQ2 :
|
||||
if(nextTor == RTT_SEND){
|
||||
if(torType == L2_TOR_TX){
|
||||
DBG_INFO("Prepare data for RTT REQ-2\n");
|
||||
rttRecord->Tt3.timeH = L2_GetNextFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetNextSlotNum(instPtr);
|
||||
rttRecord->Tt3.timeL = 0 ;
|
||||
DBG_INFO("Tt3-timeL:%u.\n", rttRecord->Tt3.timeL);
|
||||
DBG_INFO("Tt3-timeH:%u.\n", rttRecord->Tt3.timeH);
|
||||
// Update Tt3
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tt3), torType);
|
||||
|
||||
if ( rttFsmPtr->isR2Valid ) {
|
||||
// Calculate reply A
|
||||
rttRecord->TreplyA.timeL = COUNTE_FRAC_MAX - rttRecord->Tr2.timeL;
|
||||
rttRecord->TreplyA.timeH = rttRecord->Tt3.timeH - rttRecord->Tr2.timeH - 1;
|
||||
DBG_INFO("TreplyA-timeL:%u.\n", rttRecord->TreplyA.timeL);
|
||||
DBG_INFO("TreplyA-timeH:%u.\n", rttRecord->TreplyA.timeH);
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tt3), &(rttRecord->Tr2), &(rttRecord->TreplyA));
|
||||
}
|
||||
else {
|
||||
rttRecord->TreplyA.timeL = RTT_TIME_NONE;
|
||||
rttRecord->TreplyA.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-1 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_WARNING("Set TreplyA to dummy value.\n");
|
||||
DBG_INFO("TreplyA-timeL:%08X.\n", rttRecord->TreplyA.timeL);
|
||||
DBG_INFO("TreplyA-timeH:%08X.\n", rttRecord->TreplyA.timeH);
|
||||
rttRecord->TreplyA = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-1 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set Tt3 and TreplyA to dummy value.\n");
|
||||
}
|
||||
DBG_INFO("Tt3-timeL:%08X.\n", rttRecord->Tt3.frac_part);
|
||||
DBG_INFO("Tt3-timeH:%08X.\n", rttRecord->Tt3.int_part);
|
||||
DBG_INFO("TreplyA-timeL:%08X.\n", rttRecord->TreplyA.frac_part);
|
||||
DBG_INFO("TreplyA-timeH:%08X.\n", rttRecord->TreplyA.int_part);
|
||||
|
||||
// Prepare data for sending.
|
||||
rttFsmPtr->timeStamp = rttRecord->TroundA;
|
||||
rttFsmPtr->doppler = rttRecord->dopplerR2;
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_RSP2);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("Skip RTT slot, [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_RSP2 :
|
||||
if(lastTor == RTT_RCV){
|
||||
if(torType == L2_TOR_RX){
|
||||
if(L2_isDataAvail(instPtr) == true){
|
||||
DBG_INFO("RTT RSP-2 have been received.\n");
|
||||
rttFsmPtr->isR4Valid = true;
|
||||
// Calculate doppler
|
||||
// Update doppler
|
||||
double doppler = Phy_GetCoarseFreqEst(phyRef);
|
||||
rttRecord->dopplerR2 = (int32_t)doppler;
|
||||
DBG_INFO("rttRecord->dopplerR2: %d.\n", rttRecord->dopplerR2);
|
||||
|
||||
// Calculate last frame receive time.
|
||||
int32_t counter10ns = RTT_GetCounter10nsDeviation(phyRef);
|
||||
if ( counter10ns < 0) {
|
||||
counter10ns += COUNTE_FRAC_MAX;
|
||||
rttRecord->Tr4.timeH -- ;
|
||||
}
|
||||
rttRecord->Tr2.timeH = L2_GetLastFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetLastSlotNum(instPtr);
|
||||
// Get a cnt with clk of 192MHz
|
||||
rttRecord->Tr4.timeL = (uint32_t)counter10ns;
|
||||
DBG_INFO("Tr4-timeL:%u.\n", rttRecord->Tr4.timeL);
|
||||
DBG_INFO("Tr4-timeH:%u.\n", rttRecord->Tr4.timeH);
|
||||
// Update Tr4
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tr4), torType);
|
||||
// Calculate TroundA
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tt3), &(rttRecord->Tr4), &(rttRecord->TroundA));
|
||||
}
|
||||
else{
|
||||
rttFsmPtr->isR4Valid = false;
|
||||
rttRecord->Tr4.timeL = RTT_TIME_NONE;
|
||||
rttRecord->Tr4.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-2 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
DBG_WARNING("Set Tr4 to dummy value.\n");
|
||||
DBG_INFO("Tr4-timeL:%08X.\n", rttRecord->Tr4.timeL);
|
||||
DBG_INFO("Tr4-timeH:%08X.\n", rttRecord->Tr4.timeH);
|
||||
rttRecord->dopplerR4 = RTT_DOPPLER_NONE;
|
||||
rttRecord->Tr4 = RTT_TIME_NONE;
|
||||
rttRecord->TroundA = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT RSP-2 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set Tr4 dopplerR4 and TroundA to dummy value.\n");
|
||||
|
||||
}
|
||||
DBG_INFO("dopplerR4:%08X.\n", rttRecord->dopplerR4);
|
||||
DBG_INFO("Tr4-timeL:%08X.\n", rttRecord->Tr4.frac_part);
|
||||
DBG_INFO("Tr4-timeH:%08X.\n", rttRecord->Tr4.int_part);
|
||||
DBG_INFO("TroundA-timeL:%08X.\n", rttRecord->TroundA.frac_part);
|
||||
DBG_INFO("TroundA-timeH:%08X.\n", rttRecord->TroundA.int_part);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_NONE_STAGE);
|
||||
DBG_INFO("RTT procedure end...\n");
|
||||
}
|
||||
else{
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
default :
|
||||
DBG_ERROR("Unexpected RTT FSM stage [%d].\n", rttFsmPtr->rttStatge);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// For Member Node: Rx->Tx->Rx->Tx
|
||||
else{
|
||||
switch (rttFsmPtr->rttStatge.next) {
|
||||
case RTT_NONE_STAGE :
|
||||
DBG_INFO("RTT procedure start...\n");
|
||||
// TODO
|
||||
// RTT_ResetRecord(rttRecord);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_REQ1);
|
||||
break;
|
||||
switch(rttFsmPtr->rttStatge) {
|
||||
case RTT_REQ1 :
|
||||
if(lastTor == RTT_RCV){
|
||||
if(torType == L2_TOR_RX){
|
||||
if(L2_isDataAvail(instPtr) == true){
|
||||
DBG_INFO("RTT REQ-1 have been received.\n");
|
||||
DBG_INFO("Preparing data for RTT RSP-1.\n");
|
||||
rttFsmPtr->isR2Valid = true;
|
||||
// Calculate doppler
|
||||
double doppler = Phy_GetCoarseFreqEst(phyRef);
|
||||
rttRecord->dopplerR2 = (int32_t)doppler;
|
||||
DBG_INFO("rttRecord->dopplerR2: %d.\n", rttRecord->dopplerR2);
|
||||
|
||||
// Calculate last frame receive time.
|
||||
int32_t counter10ns = RTT_GetCounter10nsDeviation(phyRef);
|
||||
if ( counter10ns < 0) {
|
||||
counter10ns += COUNTE_FRAC_MAX;
|
||||
rttRecord->Tr1.timeH -- ;
|
||||
}
|
||||
rttRecord->Tr1.timeH = L2_GetLastFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetLastSlotNum(instPtr);
|
||||
rttRecord->Tr1.timeL = (uint32_t)counter10ns;
|
||||
DBG_INFO("Tr1-timeL:%u.\n", rttRecord->Tr1.timeL);
|
||||
DBG_INFO("Tr1-timeH:%u.\n", rttRecord->Tr1.timeH);
|
||||
// Update doppler
|
||||
rttRecord->dopplerR2 = (int32_t)Phy_GetCoarseFreqEst(phyRef);
|
||||
// Update Tr1
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tr1), torType);
|
||||
}
|
||||
else{
|
||||
rttFsmPtr->isR1Valid = false;
|
||||
rttRecord->dopplerR1 = RTT_DOPPLER_NONE;
|
||||
rttRecord->Tr1.timeL = RTT_TIME_NONE;
|
||||
rttRecord->Tr1.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-1 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
rttRecord->Tr1 = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-1 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set dopplerR1 and Tr1 to dummy value.\n");
|
||||
DBG_INFO("dopplerR1:%08X.\n", rttRecord->dopplerR1);
|
||||
DBG_INFO("Tr1-timeL:%08X.\n", rttRecord->Tr1.timeL);
|
||||
DBG_INFO("Tr1-timeH:%08X.\n", rttRecord->Tr1.timeH);
|
||||
}
|
||||
DBG_INFO("dopplerR1:%08X.\n", rttRecord->dopplerR1);
|
||||
DBG_INFO("Tr1-timeL:%08X.\n", rttRecord->Tr1.frac_part);
|
||||
DBG_INFO("Tr1-timeH:%08X.\n", rttRecord->Tr1.int_part);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_RSP1);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_RSP1 :
|
||||
if(nextTor == RTT_SEND){
|
||||
if(torType == L2_TOR_TX){
|
||||
DBG_INFO("Prepare data for RTT RSP-1\n");
|
||||
rttRecord->Tt2.timeH = L2_GetNextFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetNextSlotNum(instPtr);
|
||||
rttRecord->Tt2.timeL = 0 ;
|
||||
DBG_INFO("Tt2-timeL:%u.\n", rttRecord->Tt2.timeL);
|
||||
DBG_INFO("Tt2-timeH:%u.\n", rttRecord->Tt2.timeH);
|
||||
|
||||
// Update Tt2
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tt2), torType);
|
||||
if ( rttFsmPtr->isR1Valid ) {
|
||||
// Calculate reply B
|
||||
rttRecord->TreplyB.timeL = COUNTE_FRAC_MAX - rttRecord->Tr1.timeL;
|
||||
rttRecord->TreplyB.timeH = rttRecord->Tt2.timeH - rttRecord->Tr1.timeH - 1;
|
||||
DBG_INFO("TreplyB-timeL:%u.\n", rttRecord->TreplyB.timeL);
|
||||
DBG_INFO("TreplyB-timeH:%u.\n", rttRecord->TreplyB.timeH);
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tr1), &(rttRecord->Tt2), &(rttRecord->TreplyB));
|
||||
}
|
||||
else {
|
||||
rttRecord->TreplyB.timeL = RTT_TIME_NONE;
|
||||
rttRecord->TreplyB.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-1 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
rttRecord->TreplyB = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-1 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set ReplayB to dummy value.\n");
|
||||
DBG_INFO("TreplyB-timeL:%08X.\n", rttRecord->TreplyB.timeL);
|
||||
DBG_INFO("TreplyB-timeH:%08X.\n", rttRecord->TreplyB.timeH);
|
||||
}
|
||||
DBG_INFO("Tt2-timeL:%u.\n", rttRecord->Tt2.frac_part);
|
||||
DBG_INFO("Tt2-timeH:%u.\n", rttRecord->Tt2.int_part);
|
||||
DBG_INFO("TreplyB-timeL:%08X.\n", rttRecord->TreplyB.frac_part);
|
||||
DBG_INFO("TreplyB-timeH:%08X.\n", rttRecord->TreplyB.int_part);
|
||||
|
||||
// Prepare data for sending.
|
||||
rttFsmPtr->timeStamp = rttRecord->TreplyB;
|
||||
rttFsmPtr->doppler = rttRecord->dopplerR1;
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_REQ2);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_REQ2 :
|
||||
if(lastTor == RTT_RCV){
|
||||
if(torType == L2_TOR_RX){
|
||||
if(L2_isDataAvail(instPtr) == true){
|
||||
DBG_INFO("RTT REQ-2 have been received.\n");
|
||||
DBG_INFO("Preparing data for RTT RSP-2.\n");
|
||||
rttFsmPtr->isR3Valid = true;
|
||||
|
||||
// Calculate doppler
|
||||
double doppler = Phy_GetCoarseFreqEst(phyRef);
|
||||
rttRecord->dopplerR2 = (int32_t)doppler;
|
||||
DBG_INFO("rttRecord->dopplerR2: %d.\n", rttRecord->dopplerR2);
|
||||
|
||||
// Calculate last frame receive time.
|
||||
int32_t counter10ns = RTT_GetCounter10nsDeviation(phyRef);
|
||||
if ( counter10ns < 0) {
|
||||
counter10ns += COUNTE_FRAC_MAX;
|
||||
rttRecord->Tr3.timeH -- ;
|
||||
}
|
||||
rttRecord->Tr3.timeL = (uint32_t)counter10ns;
|
||||
DBG_INFO("Tr3-timeL:%u.\n", rttRecord->Tr3.timeL);
|
||||
DBG_INFO("Tr3-timeH:%u.\n", rttRecord->Tr3.timeH);
|
||||
|
||||
// Update doppler
|
||||
rttRecord->dopplerR2 = (int32_t)Phy_GetCoarseFreqEst(phyRef);
|
||||
// Update Tr3
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tr3), torType);
|
||||
// Calculate TroundB
|
||||
rttRecord->TroundB.timeL = rttRecord->Tr3.timeL;
|
||||
rttRecord->TroundB.timeH = rttRecord->Tr3.timeH - rttRecord->Tt2.timeH;
|
||||
DBG_INFO("TroundB-timeL:%u.\n", rttRecord->TroundB.timeL);
|
||||
DBG_INFO("TroundB-timeH:%u.\n", rttRecord->TroundB.timeH);
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tt2), &(rttRecord->Tr3), &(rttRecord->TroundB));
|
||||
}
|
||||
else{
|
||||
rttFsmPtr->isR3Valid = false;
|
||||
rttRecord->dopplerR3 = RTT_DOPPLER_NONE;
|
||||
rttRecord->TroundB.timeL = RTT_TIME_NONE;
|
||||
rttRecord->TroundB.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-2 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
rttRecord->TroundB = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-2 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set dopplerR3 and ReplayB to dummy value.\n");
|
||||
DBG_INFO("dopplerR3:%08X.\n", rttRecord->dopplerR3);
|
||||
DBG_INFO("TroundB-timeL:%08X.\n", rttRecord->TroundB.timeL);
|
||||
DBG_INFO("TroundB-timeH:%08X.\n", rttRecord->TroundB.timeH);
|
||||
}
|
||||
DBG_INFO("dopplerR3:%08X.\n", rttRecord->dopplerR3);
|
||||
DBG_INFO("Tr3-timeL:%u.\n", rttRecord->Tr3.frac_part);
|
||||
DBG_INFO("Tr3-timeH:%u.\n", rttRecord->Tr3.int_part);
|
||||
DBG_INFO("TroundB-timeL:%08X.\n", rttRecord->TroundB.frac_part);
|
||||
DBG_INFO("TroundB-timeH:%08X.\n", rttRecord->TroundB.int_part);
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_RSP2);
|
||||
}
|
||||
else{
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
case RTT_RSP2 :
|
||||
if(nextTor == RTT_SEND){
|
||||
if(torType == L2_TOR_TX){
|
||||
DBG_INFO("Prepare data for RTT RSP-2\n");
|
||||
rttRecord->Tt4.timeH = L2_GetNextFrameNum(instPtr)*L2_SLOTS_PER_FRAME + L2_GetNextSlotNum(instPtr);
|
||||
rttRecord->Tt4.timeL = 0;
|
||||
DBG_INFO("Tt4-timeL:%u.\n", rttRecord->Tt4.timeL);
|
||||
DBG_INFO("Tt4-timeH:%u.\n", rttRecord->Tt4.timeH);
|
||||
|
||||
// Update Tt4
|
||||
RTT_GetFrameStart(instPtr, &(rttRecord->Tt4), torType);
|
||||
if ( rttFsmPtr->isR3Valid ) {
|
||||
// Calculate reply B
|
||||
rttRecord->TreplyB.timeL = COUNTE_FRAC_MAX - rttRecord->Tr3.timeL;
|
||||
rttRecord->TreplyB.timeH = rttRecord->Tt4.timeH - rttRecord->Tr3.timeH - 1;
|
||||
DBG_INFO("TreplyB-timeL:%u.\n", rttRecord->TreplyB.timeL);
|
||||
DBG_INFO("TreplyB-timeH:%u.\n", rttRecord->TreplyB.timeH);
|
||||
// TODO implement a time adjustment.
|
||||
DBG_INFO("RTT procedure end...\n");
|
||||
RTT_CalculateTimeGap(&(rttRecord->Tr3), &(rttRecord->Tt4), &(rttRecord->TreplyB));
|
||||
// TODO: implement a time adjustment.
|
||||
}
|
||||
else {
|
||||
rttRecord->TreplyB.timeL = RTT_TIME_NONE;
|
||||
rttRecord->TreplyB.timeH = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-2 have not been received [Stage: %u].\n", rttFsmPtr->rttStatge.next);
|
||||
rttRecord->TreplyB = RTT_TIME_NONE;
|
||||
DBG_WARNING("RTT REQ-2 have not been received [Stage: %d].\n", rttFsmPtr->rttStatge);
|
||||
DBG_WARNING("Set ReplayB to dummy value.\n");
|
||||
DBG_INFO("TreplyB-timeL:%08X.\n", rttRecord->TreplyB.timeL);
|
||||
DBG_INFO("TreplyB-timeH:%08X.\n", rttRecord->TreplyB.timeH);
|
||||
}
|
||||
DBG_INFO("Tt4-timeL:%u.\n", rttRecord->Tt4.frac_part);
|
||||
DBG_INFO("Tt4-timeH:%u.\n", rttRecord->Tt4.int_part);
|
||||
DBG_INFO("TreplyB-timeL:%08X.\n", rttRecord->TreplyB.frac_part);
|
||||
DBG_INFO("TreplyB-timeH:%08X.\n", rttRecord->TreplyB.int_part);
|
||||
|
||||
// Prepare data for sending.
|
||||
rttFsmPtr->timeStamp = rttRecord->TreplyB;
|
||||
rttFsmPtr->doppler = rttRecord->dopplerR3;
|
||||
RTT_StageUpdate(rttFsmPtr, RTT_NONE_STAGE);
|
||||
DBG_INFO("RTT procedure end...\n");
|
||||
}
|
||||
else{
|
||||
DBG_INFO("RTT FSM remain current state [%d].\n", rttFsmPtr->rttStatge);
|
||||
}
|
||||
break;
|
||||
default :
|
||||
default:
|
||||
DBG_ERROR("Unexpected RTT FSM stage [%d].\n", rttFsmPtr->rttStatge);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ int MPC_StateUpload(MPC_INST* instPtr , uint8_t* mgmtBuffer , uint32_t mgmtMsgC
|
||||
|
||||
// TODO : Currently DJ is node 1 , only Byte 1 is activate , others is useless
|
||||
// Topo node 1
|
||||
dataChunk = BIT(linkInstPtr->myInfo.nodeId - 1);
|
||||
dataChunk = BIT(L2_GetNodeId(linkInstPtr) - 1);
|
||||
if (GetNodeNum(linkInstPtr->nodeList) > 1 ) {
|
||||
for(int i = 1; i <= linkInstPtr->config.netScale; i++){
|
||||
if (IsNodeInList(linkInstPtr->nodeList, i)) {
|
||||
|
||||
@@ -16,7 +16,7 @@ BIARRAY_SRC := $(wildcard ../src/bit_array/*.c ../src/bit_array/*.h)
|
||||
CC ?= gcc
|
||||
|
||||
# Compiler flags
|
||||
CFLAGS ?= --std=c11 -O0 -I../src -Wall -Werror -pedantic -g -Wno-sign-compare -Wno-comment
|
||||
CFLAGS ?= --std=c11 -O0 -I../src -Wall -Wformat=2 -Werror -pedantic -g -Wno-sign-compare -Wno-comment
|
||||
|
||||
# Add sanitizer flags for identifying undefined behavior. The flags are
|
||||
# different on macOS (AKA Darwin) and Windows/WSL/Linux.
|
||||
@@ -27,13 +27,17 @@ else
|
||||
CFLAGS += -m32 -fsanitize=address -fsanitize=undefined -D_GLIBCC_DEBUG
|
||||
endif
|
||||
|
||||
tmc_board_unit_test: tmc_board_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
|
||||
test: tmc_emulate_unit_test.exe linklayer_emulate_unit_test.exe
|
||||
./tmc_emulate_unit_test.exe > tmc_emulate_unit_test.log
|
||||
./linklayer_emulate_unit_test.exe > linklayer_emulate_unit_test.log
|
||||
|
||||
tmc_board_unit_test.exe: tmc_board_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
|
||||
$(CC) $(CFLAGS) $(filter %.c, $^) -o $@
|
||||
|
||||
tmc_emulate_unit_test: tmc_emulate_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
|
||||
tmc_emulate_unit_test.exe: tmc_emulate_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
|
||||
$(CC) $(CFLAGS) -DEMULATION $(filter %.c, $^) -o $@
|
||||
|
||||
linklayer_emulate_unit_test: linklayer_emulate_unit_test.c \
|
||||
linklayer_emulate_unit_test.exe: linklayer_emulate_unit_test.c \
|
||||
$(LINK_SRC) \
|
||||
$(BIARRAY_SRC) \
|
||||
$(GEOMETRY_SRC) \
|
||||
@@ -44,7 +48,7 @@ linklayer_emulate_unit_test: linklayer_emulate_unit_test.c \
|
||||
$(TEST_FRAME)
|
||||
$(CC) $(CFLAGS) -lm -DEMULATION $(filter %.c, $^) -o $@
|
||||
clean:
|
||||
rm -f *_unit_test
|
||||
rm -f *.exe *.log
|
||||
|
||||
# Style check
|
||||
CPD ?= $(PMD_HOME)/bin/run.sh cpd
|
||||
|
||||
@@ -23,11 +23,11 @@ $(PROCESSOR)/lib/libxil.a: $(PROCESSOR)/lib/libxil_init.a
|
||||
|
||||
%/make.include: $(if $(wildcard $(PROCESSOR)/lib/libxil_init.a),$(PROCESSOR)/lib/libxil.a,)
|
||||
@echo "Running Make include in $(subst /make.include,,$@)"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.libs: include
|
||||
@echo "Running Make libs in $(subst /make.libs,,$@)"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=mb-ar" "COMPILER_FLAGS= -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-ffunction-sections -fdata-sections -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.clean:
|
||||
$(MAKE) -C $(subst /make.clean,,$@) -s clean
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/api/%.o: ../src/adi_noos/drivers/api/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/axi_core/axi_dmac/%.o: ../src/adi_noos/drivers/axi_core/axi_dmac/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/axi_core/spi_engine/%.o: ../src/adi_noos/drivers/axi_core/spi_engine/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/frequency/ad9516/%.o: ../src/adi_noos/drivers/frequency/ad9516/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/platform/%.o: ../src/adi_noos/drivers/platform/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/adi_noos/drivers/rf-transceiver/ad9361_reg/%.o: ../src/adi_noos/drivers/rf-transceiver/ad9361_reg/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ C_DEPS += \
|
||||
src/axi_dma/%.o: ../src/axi_dma/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/c2c_bridge/%.o: ../src/c2c_bridge/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/circ_queue/%.o: ../src/circ_queue/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/dev_profile/%.o: ../src/dev_profile/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/inter_comm/%.o: ../src/inter_comm/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/phy_ctrl/%.o: ../src/phy_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/%.o: ../src/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/time_ctrl/%.o: ../src/time_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/util/%.o: ../src/util/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: MicroBlaze gcc compiler'
|
||||
$(CC) -Wall -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -Os -g3 -c -fmessage-length=0 -MT"$@" -I../bsp/microblaze_ps/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-div -mcpu=v11.0 -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ $(PROCESSOR)/lib/libxil.a: $(PROCESSOR)/lib/libxil_init.a
|
||||
|
||||
%/make.include: $(if $(wildcard $(PROCESSOR)/lib/libxil_init.a),$(PROCESSOR)/lib/libxil.a,)
|
||||
@echo "Running Make include in $(subst /make.include,,$@)"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-DDEBUG -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.include,,$@) -s include "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-DDEBUG -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.libs: include
|
||||
@echo "Running Make libs in $(subst /make.libs,,$@)"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-DDEBUG -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
|
||||
$(MAKE) -C $(subst /make.libs,,$@) -s libs "SHELL=$(SHELL)" "COMPILER=$(CC)" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-DDEBUG -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wformat=2 -Wextra"
|
||||
|
||||
%/make.clean:
|
||||
$(MAKE) -C $(subst /make.clean,,$@) -s clean
|
||||
|
||||
@@ -32,7 +32,7 @@ C_DEPS += \
|
||||
src/dev_profile/%.o: ../src/dev_profile/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/drivers/adc/ad9694/%.o: ../src/drivers/adc/ad9694/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ C_DEPS += \
|
||||
src/drivers/api/%.o: ../src/drivers/api/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/drivers/axi_core/axi_dmac/%.o: ../src/drivers/axi_core/axi_dmac/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/drivers/axi_core/spi_engine/%.o: ../src/drivers/axi_core/spi_engine/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/drivers/frequency/hmc7044/%.o: ../src/drivers/frequency/hmc7044/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ C_DEPS += \
|
||||
src/drivers/platform/%.o: ../src/drivers/platform/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ C_DEPS += \
|
||||
src/drivers/rf-transceiver/ad9361/%.o: ../src/drivers/rf-transceiver/ad9361/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ C_DEPS += \
|
||||
src/drivers/rf-transceiver/ad9361_reg/%.o: ../src/drivers/rf-transceiver/ad9361_reg/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/networking/link_layer/geometry/%.o: ../src/networking/link_layer/geometry/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ C_DEPS += \
|
||||
src/networking/link_layer/%.o: ../src/networking/link_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/networking/phy_layer/%.o: ../src/networking/phy_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ C_DEPS += \
|
||||
src/%.o: ../src/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/systembus/%.o: ../src/systembus/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ C_DEPS += \
|
||||
src/util/%.o: ../src/util/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
Reference in New Issue
Block a user