From 037fdb64ebafa60ccbd8aabd4c53aafb89cda55d Mon Sep 17 00:00:00 2001 From: wmano Date: Sun, 28 Sep 2025 23:00:52 +0800 Subject: [PATCH] add roll thread --- apps/chrg/applications/thread/chrg_comm.c | 155 ++++------ apps/chrg/applications/thread/chrg_comm.h | 4 +- apps/chrg/applications/thread/chrg_north.c | 4 +- apps/chrg/applications/thread/chrg_north.h | 1 + apps/chrg/applications/thread/chrg_roll.c | 144 +++++++++ apps/chrg/applications/thread/chrg_roll.h | 34 +++ apps/chrg/applications/thread/chrg_south.c | 6 +- apps/chrg/applications/thread/chrg_south.h | 1 + apps/chrg/applications/utils/chrg_sink.c | 7 + apps/chrg/applications/utils/chrg_sink.h | 2 +- apps/chrg/applications/utils/chrg_source.h | 2 +- apps/chrg/applications/utils/chrg_utils.c | 2 +- apps/chrg/applications/utils/chrg_utils.h | 2 +- apps/chrg/chrg.uvprojx | 333 +++++++++++---------- 14 files changed, 427 insertions(+), 270 deletions(-) create mode 100644 apps/chrg/applications/thread/chrg_roll.c create mode 100644 apps/chrg/applications/thread/chrg_roll.h diff --git a/apps/chrg/applications/thread/chrg_comm.c b/apps/chrg/applications/thread/chrg_comm.c index 3fb70e6..efe0ca4 100644 --- a/apps/chrg/applications/thread/chrg_comm.c +++ b/apps/chrg/applications/thread/chrg_comm.c @@ -11,10 +11,10 @@ #include rt_uint16_t usSDiscInStart = S_DISCRETE_INPUT_START; -rt_uint8_t ucSDiscInBuf[(S_DISCRETE_INPUT_NDISCRETES+7)/8]; +rt_uint8_t ucSDiscInBuf[(S_DISCRETE_INPUT_NDISCRETES+BITS_UCHAR-1)/BITS_UCHAR]; rt_uint16_t usSCoilStart = S_COIL_START; -rt_uint8_t ucSCoilBuf[(S_COIL_NCOILS+7)/8]; +rt_uint8_t ucSCoilBuf[(S_COIL_NCOILS+BITS_UCHAR-1)/BITS_UCHAR]; rt_uint16_t usSRegInStart = S_REG_INPUT_START; rt_uint16_t usSRegInBuf[S_REG_INPUT_NREGS]; @@ -22,7 +22,7 @@ rt_uint16_t usSRegInBuf[S_REG_INPUT_NREGS]; rt_uint16_t usSRegHoldStart = S_REG_HOLDING_START; rt_uint16_t usSRegHoldBuf[S_REG_HOLDING_NREGS]; -#define BITS_UCHAR 8U + struct chrg_comm_t chrgcomm = { .name = THR_NAME_COMM, @@ -58,16 +58,16 @@ struct chrg_comm_t chrgcomm = { * ucBits[2] = {0, 0}; * * // Set bit 4 to 1 (read: set 1 bit starting at bit offset 4 to value 1) - * xMBUtilSetBits( ucBits, 4, 1, 1 ); + * mb_set_bits( ucBits, 4, 1, 1 ); * * // Set bit 7 to 1 and bit 8 to 0. - * xMBUtilSetBits( ucBits, 7, 2, 0x01 ); + * mb_set_bits( ucBits, 7, 2, 0x01 ); * * // Set bits 8 - 11 to 0x05 and bits 12 - 15 to 0x0A; - * xMBUtilSetBits( ucBits, 8, 8, 0x5A); + * mb_set_bits( ucBits, 8, 8, 0x5A); * \endcode */ -void xMBUtilSetBits (rt_uint8_t *ucByteBuf, rt_uint16_t usBitOffset, +void mb_set_bits (rt_uint8_t *ucByteBuf, rt_uint16_t usBitOffset, rt_uint8_t ucNBits, rt_uint8_t ucValue) { rt_uint16_t usWordBuf; @@ -76,7 +76,7 @@ void xMBUtilSetBits (rt_uint8_t *ucByteBuf, rt_uint16_t usBitOffset, rt_uint16_t usNPreBits; rt_uint16_t usValue = ucValue; - RT_ASSERT(ucNBits <= 8); + RT_ASSERT(ucNBits <= BITS_UCHAR); RT_ASSERT((size_t)BITS_UCHAR == sizeof(rt_uint8_t) * 8); /* Calculate byte offset for first byte containing the bit values starting @@ -121,10 +121,10 @@ void xMBUtilSetBits (rt_uint8_t *ucByteBuf, rt_uint16_t usBitOffset, * rt_uint8_t ucResult; * * // Extract the bits 3 - 10. - * ucResult = xMBUtilGetBits( ucBits, 3, 8 ); + * ucResult = mb_get_bits( ucBits, 3, 8 ); * \endcode */ -rt_uint8_t xMBUtilGetBits (rt_uint8_t * ucByteBuf, rt_uint16_t usBitOffset, rt_uint8_t ucNBits) +rt_uint8_t mb_get_bits (rt_uint8_t * ucByteBuf, rt_uint16_t usBitOffset, rt_uint8_t ucNBits) { rt_uint16_t usWordBuf; rt_uint16_t usMask; @@ -154,7 +154,7 @@ rt_uint8_t xMBUtilGetBits (rt_uint8_t * ucByteBuf, rt_uint16_t usBitOffset, rt_u return (rt_uint8_t)usWordBuf; } -static eMBException prveMBError2Exception (eMBErrorCode eErrorCode) +static eMBException mb_error (eMBErrorCode eErrorCode) { eMBException eStatus; @@ -180,17 +180,7 @@ static eMBException prveMBError2Exception (eMBErrorCode eErrorCode) } - -/** - * Modbus slave input register callback function. - * - * @param pucRegBuffer input register buffer - * @param usAddress input register address - * @param usNRegs input register number - * - * @return result - */ -eMBErrorCode eMBRegInputCB (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNRegs) +eMBErrorCode mb_reg_input_cb (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNRegs) { eMBErrorCode eStatus = MB_ENOERR; rt_uint16_t iRegIndex; @@ -203,7 +193,7 @@ eMBErrorCode eMBRegInputCB (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_ && (usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS)) { iRegIndex = usAddress - usRegInStart; while (usNRegs > 0) { - *pucRegBuffer++ = (rt_uint8_t)(pusRegInputBuf[iRegIndex] >> 8); + *pucRegBuffer++ = (rt_uint8_t)(pusRegInputBuf[iRegIndex] >> BITS_UCHAR); *pucRegBuffer++ = (rt_uint8_t)(pusRegInputBuf[iRegIndex] & 0xFF); iRegIndex++; usNRegs--; @@ -215,17 +205,7 @@ eMBErrorCode eMBRegInputCB (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_ return eStatus; } -/** - * Modbus slave holding register callback function. - * - * @param pucRegBuffer holding register buffer - * @param usAddress holding register address - * @param usNRegs holding register number - * @param eMode read or write - * - * @return result - */ -eMBErrorCode eMBRegHoldingCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, +eMBErrorCode mb_reg_holding_cb (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNRegs, eMBRegisterMode eMode) { eMBErrorCode eStatus = MB_ENOERR; @@ -242,7 +222,7 @@ eMBErrorCode eMBRegHoldingCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint /* read current register values from the protocol stack. */ case MB_REG_READ: while (usNRegs > 0) { - *pucRegBuffer++ = (rt_uint8_t)(pusRegHoldingBuf[iRegIndex] >> 8); + *pucRegBuffer++ = (rt_uint8_t)(pusRegHoldingBuf[iRegIndex] >> BITS_UCHAR); *pucRegBuffer++ = (rt_uint8_t)(pusRegHoldingBuf[iRegIndex] & 0xFF); iRegIndex++; usNRegs--; @@ -252,7 +232,7 @@ eMBErrorCode eMBRegHoldingCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint /* write current register values with new values from the protocol stack. */ case MB_REG_WRITE: while (usNRegs > 0) { - pusRegHoldingBuf[iRegIndex] = *req++ << 8; + pusRegHoldingBuf[iRegIndex] = *req++ << BITS_UCHAR; pusRegHoldingBuf[iRegIndex] |= *req++; iRegIndex++; usNRegs--; @@ -266,17 +246,7 @@ eMBErrorCode eMBRegHoldingCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint return eStatus; } -/** - * Modbus slave coils callback function. - * - * @param pucRegBuffer coils buffer - * @param usAddress coils address - * @param usNCoils coils number - * @param eMode read or write - * - * @return result - */ -eMBErrorCode eMBRegCoilsCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, +eMBErrorCode mb_reg_coils_cb (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNCoils, eMBRegisterMode eMode) { eMBErrorCode eStatus = MB_ENOERR; @@ -286,37 +256,37 @@ eMBErrorCode eMBRegCoilsCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16 rt_uint16_t COIL_NCOILS = S_COIL_NCOILS; rt_uint16_t usCoilStart = usSCoilStart; - iNReg = (usNCoils+7)/8; + iNReg = (usNCoils+BITS_UCHAR-1)/BITS_UCHAR; if ((usAddress >= COIL_START) && (usAddress + usNCoils <= COIL_START + COIL_NCOILS)) { - iRegIndex = (rt_uint16_t)(usAddress - usCoilStart) / 8; - iRegBitIndex = (rt_uint16_t)(usAddress - usCoilStart) % 8; + iRegIndex = (rt_uint16_t)(usAddress - usCoilStart) / BITS_UCHAR; + iRegBitIndex = (rt_uint16_t)(usAddress - usCoilStart) % BITS_UCHAR; switch (eMode) { /* read current coil values from the protocol stack. */ case MB_REG_READ: while (iNReg > 0) { - *pucRegBuffer++ = xMBUtilGetBits(&pucCoilBuf[iRegIndex++], iRegBitIndex, 8); + *pucRegBuffer++ = mb_get_bits(&pucCoilBuf[iRegIndex++], iRegBitIndex, BITS_UCHAR); iNReg--; } pucRegBuffer--; /* last coils */ - usNCoils = usNCoils % 8; + usNCoils = usNCoils % BITS_UCHAR; /* filling zero to high bit */ - *pucRegBuffer = *pucRegBuffer << (8 - usNCoils); - *pucRegBuffer = *pucRegBuffer >> (8 - usNCoils); + *pucRegBuffer = *pucRegBuffer << (BITS_UCHAR - usNCoils); + *pucRegBuffer = *pucRegBuffer >> (BITS_UCHAR - usNCoils); break; /* write current coil values with new values from the protocol stack. */ case MB_REG_WRITE: while (iNReg > 1) { - xMBUtilSetBits(&pucCoilBuf[iRegIndex++], iRegBitIndex, 8, *req++); + mb_set_bits(&pucCoilBuf[iRegIndex++], iRegBitIndex, BITS_UCHAR, *req++); iNReg--; } /* last coils */ - usNCoils = usNCoils % 8; - /* xMBUtilSetBits has bug when ucNBits is zero */ + usNCoils = usNCoils % BITS_UCHAR; + /* mb_set_bits has bug when ucNBits is zero */ if (usNCoils != 0) { - xMBUtilSetBits(&pucCoilBuf[iRegIndex++], iRegBitIndex, usNCoils, *req++); + mb_set_bits(&pucCoilBuf[iRegIndex++], iRegBitIndex, usNCoils, *req++); } break; } @@ -327,16 +297,7 @@ eMBErrorCode eMBRegCoilsCB (rt_uint8_t *req, rt_uint8_t *pucRegBuffer, rt_uint16 return eStatus; } -/** - * Modbus slave discrete callback function. - * - * @param pucRegBuffer discrete buffer - * @param usAddress discrete address - * @param usNDiscrete discrete number - * - * @return result - */ -eMBErrorCode eMBRegDiscreteCB (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNDiscrete) +eMBErrorCode mb_reg_discrete_cb (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t usNDiscrete) { eMBErrorCode eStatus = MB_ENOERR; rt_uint16_t iRegIndex , iRegBitIndex , iNReg; @@ -344,23 +305,23 @@ eMBErrorCode eMBRegDiscreteCB (rt_uint8_t *pucRegBuffer, rt_uint16_t usAddress, rt_uint16_t DISCRETE_INPUT_START = S_DISCRETE_INPUT_START; rt_uint16_t DISCRETE_INPUT_NDISCRETES = S_DISCRETE_INPUT_NDISCRETES; rt_uint16_t usDiscreteInputStart = usSDiscInStart; - iNReg = usNDiscrete / 8 + 1; + iNReg = (usNDiscrete+BITS_UCHAR-1) / BITS_UCHAR; if ((usAddress >= DISCRETE_INPUT_START) && ((usAddress + usNDiscrete) <= (DISCRETE_INPUT_START + DISCRETE_INPUT_NDISCRETES))) { - iRegIndex = (rt_uint16_t) (usAddress - usDiscreteInputStart) / 8; - iRegBitIndex = (rt_uint16_t) (usAddress - usDiscreteInputStart) % 8; + iRegIndex = (rt_uint16_t) (usAddress - usDiscreteInputStart) / BITS_UCHAR; + iRegBitIndex = (rt_uint16_t) (usAddress - usDiscreteInputStart) % BITS_UCHAR; while (iNReg > 0) { - *pucRegBuffer++ = xMBUtilGetBits(&pucDiscreteInputBuf[iRegIndex++], iRegBitIndex, 8); + *pucRegBuffer++ = mb_get_bits(&pucDiscreteInputBuf[iRegIndex++], iRegBitIndex, BITS_UCHAR); iNReg--; } pucRegBuffer--; /* last discrete */ - usNDiscrete = usNDiscrete % 8; + usNDiscrete = usNDiscrete % BITS_UCHAR; /* filling zero to high bit */ - *pucRegBuffer = *pucRegBuffer << (8 - usNDiscrete); - *pucRegBuffer = *pucRegBuffer >> (8 - usNDiscrete); + *pucRegBuffer = *pucRegBuffer << (BITS_UCHAR - usNDiscrete); + *pucRegBuffer = *pucRegBuffer >> (BITS_UCHAR - usNDiscrete); } else { eStatus = MB_ENOREG; } @@ -387,13 +348,13 @@ eMBException funcReadCoils (rt_uint8_t *reqFrame, rt_uint16_t reqLen, return MB_EX_ILLEGAL_DATA_VALUE; } - ucNBytes = (cntCoils+7)/8; + ucNBytes = (cntCoils+BITS_UCHAR-1)/BITS_UCHAR; resFrame[1] = MB_READ_COILS; resFrame[2] = ucNBytes; - eRegStatus = eMBRegCoilsCB(RT_NULL, &resFrame[3], regAddress, cntCoils, MB_REG_READ); + eRegStatus = mb_reg_coils_cb(RT_NULL, &resFrame[3], regAddress, cntCoils, MB_REG_READ); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } else { *resLen = 3+ucNBytes; } @@ -420,13 +381,13 @@ eMBException funcReadDiscreteInputs (rt_uint8_t *reqFrame, rt_uint16_t reqLen, return MB_EX_ILLEGAL_DATA_VALUE; } - ucNBytes = (cntDisCrete+7)/8; + ucNBytes = (cntDisCrete+BITS_UCHAR-1)/BITS_UCHAR; resFrame[1] = MB_READ_DISCRETE_INPUTS; resFrame[2] = ucNBytes; - eRegStatus = eMBRegDiscreteCB(&resFrame[3], regAddress, cntDisCrete); + eRegStatus = mb_reg_discrete_cb(&resFrame[3], regAddress, cntDisCrete); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } else { *resLen = 3+ucNBytes; } @@ -456,9 +417,9 @@ eMBException funcReadHoldingRegister (rt_uint8_t *reqFrame, rt_uint16_t reqLen, resFrame[1] = MB_READ_HOLDING_REGISTER; resFrame[2] = cntReg * 2; - eRegStatus = eMBRegHoldingCB(RT_NULL, &resFrame[3], regAddress, cntReg, MB_REG_READ); + eRegStatus = mb_reg_holding_cb(RT_NULL, &resFrame[3], regAddress, cntReg, MB_REG_READ); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } else { *resLen = 3+cntReg * 2; } @@ -488,9 +449,9 @@ eMBException funcReadInputRegister (rt_uint8_t *reqFrame, rt_uint16_t reqLen, resFrame[1] = MB_READ_INPUT_REGISTER; resFrame[2] = cntReg * 2; - eRegStatus = eMBRegDiscreteCB(&resFrame[3], regAddress, cntReg); + eRegStatus = mb_reg_discrete_cb(&resFrame[3], regAddress, cntReg); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } else { *resLen = 3+cntReg*2; } @@ -527,9 +488,9 @@ eMBException funcWriteCoil (rt_uint8_t *reqFrame, rt_uint16_t reqLen, memcpy(resFrame, reqFrame, reqLen); *resLen = reqLen-2; - eRegStatus = eMBRegCoilsCB(RT_NULL, ucBuf, regAddress, 1, MB_REG_WRITE); + eRegStatus = mb_reg_coils_cb(RT_NULL, ucBuf, regAddress, 1, MB_REG_WRITE); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } return eStatus; @@ -552,9 +513,9 @@ eMBException funcWriteHoldingRegister (rt_uint8_t *reqFrame, rt_uint16_t reqLen, memcpy(resFrame, reqFrame, reqLen); *resLen = reqLen-2; - eRegStatus = eMBRegHoldingCB(&reqFrame[4], &resFrame[3], regAddress, 1, MB_REG_WRITE); + eRegStatus = mb_reg_holding_cb(&reqFrame[4], &resFrame[3], regAddress, 1, MB_REG_WRITE); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } return eStatus; @@ -577,7 +538,7 @@ eMBException funcWriteMultipleCoils (rt_uint8_t *reqFrame, rt_uint16_t reqLen, regAddress = u8v_to_u16(&reqFrame[2]); cntCoils = u8v_to_u16(&reqFrame[4]); ucByteCount = reqFrame[6]; - ucByteCountVerify = (cntCoils+7)/8; + ucByteCountVerify = (cntCoils+BITS_UCHAR-1)/BITS_UCHAR; if ((0 == cntCoils) ||(cntCoils > MB_PDU_FUNC_WRITE_MUL_COILCNT_MAX) @@ -588,9 +549,9 @@ eMBException funcWriteMultipleCoils (rt_uint8_t *reqFrame, rt_uint16_t reqLen, memcpy(resFrame, reqFrame, reqLen); *resLen = 6; - eRegStatus = eMBRegCoilsCB(reqFrame, &resFrame[3], regAddress, cntCoils, MB_REG_WRITE); + eRegStatus = mb_reg_coils_cb(reqFrame, &resFrame[3], regAddress, cntCoils, MB_REG_WRITE); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } return eStatus; @@ -622,9 +583,9 @@ eMBException funcWriteMultipleHoldingRegister (rt_uint8_t *reqFrame, rt_uint16_t memcpy(resFrame, reqFrame, reqLen); *resLen = 6; - eRegStatus = eMBRegHoldingCB(reqFrame, &resFrame[3], regAddress, cntReg, MB_REG_WRITE); + eRegStatus = mb_reg_holding_cb(reqFrame, &resFrame[3], regAddress, cntReg, MB_REG_WRITE); if (eRegStatus != MB_ENOERR) { - eStatus = prveMBError2Exception(eRegStatus); + eStatus = mb_error(eRegStatus); } return eStatus; @@ -654,8 +615,8 @@ static int chrg_comm_parse_msg (struct chrg_comm_t *pCOMM) return -2; } - if (0 != usMBCRC16(pCOMM->rx_buf, pCOMM->rx_len)) { - rt_kprintf("crc %04X ", usMBCRC16(pCOMM->rx_buf, pCOMM->rx_len-2)); + if (0 != mb_crc16(pCOMM->rx_buf, pCOMM->rx_len)) { + rt_kprintf("crc %04X ", mb_crc16(pCOMM->rx_buf, pCOMM->rx_len-2)); return -3; } @@ -692,7 +653,7 @@ static int chrg_comm_parse_msg (struct chrg_comm_t *pCOMM) pCOMM->tx_len = 3; } - crc = usMBCRC16(pCOMM->tx_buf, pCOMM->tx_len); + crc = mb_crc16(pCOMM->tx_buf, pCOMM->tx_len); u16_to_u8v(crc, &pCOMM->tx_buf[pCOMM->tx_len]); pCOMM->tx_len += 2; diff --git a/apps/chrg/applications/thread/chrg_comm.h b/apps/chrg/applications/thread/chrg_comm.h index d2b5305..b93d6d8 100644 --- a/apps/chrg/applications/thread/chrg_comm.h +++ b/apps/chrg/applications/thread/chrg_comm.h @@ -5,11 +5,11 @@ #include "chrg_tty.h" -#define THR_NAME_POLL "thr.poll" -#define THR_NAME_SEND "thr.send" #define MODBUS_ADDRESS_DEFAULT 0x01 +#define BITS_UCHAR 8U + #define S_DISCRETE_INPUT_START 0 #define S_DISCRETE_INPUT_NDISCRETES 16 #define S_COIL_START 0 diff --git a/apps/chrg/applications/thread/chrg_north.c b/apps/chrg/applications/thread/chrg_north.c index 4fe1352..98df354 100644 --- a/apps/chrg/applications/thread/chrg_north.c +++ b/apps/chrg/applications/thread/chrg_north.c @@ -2,7 +2,7 @@ #include #include "chrg_north.h" - +#include "chrg_roll.h" #include "chrg_utils.h" #define LOG_TAG "chrg.nor" @@ -59,7 +59,7 @@ static void chrg_north_thread_entry (void *data) //rt_kprintf("%s\r\n", (char *)pNOR->rx_buf); //chrg_tty_send(pTTY, pNOR->rx_buf, len); - + chrg_roll_evt_send(); } diff --git a/apps/chrg/applications/thread/chrg_north.h b/apps/chrg/applications/thread/chrg_north.h index 04c7161..e3d1eae 100644 --- a/apps/chrg/applications/thread/chrg_north.h +++ b/apps/chrg/applications/thread/chrg_north.h @@ -20,6 +20,7 @@ struct chrg_north_t { rt_uint16_t rx_len; rt_uint8_t rx_buf[SIZE_BUF_TTY]; + eIDX_CH idx; // 当前通路 struct chrg_switch_t sw[TOTAL_CHS]; }; diff --git a/apps/chrg/applications/thread/chrg_roll.c b/apps/chrg/applications/thread/chrg_roll.c new file mode 100644 index 0000000..2138267 --- /dev/null +++ b/apps/chrg/applications/thread/chrg_roll.c @@ -0,0 +1,144 @@ + +#include + +#include "chrg_north.h" +#include "chrg_south.h" +#include "chrg_sink.h" +#include "chrg_source.h" +#include "chrg_roll.h" + +#define LOG_TAG "chrg.roll" +#include + +struct chrg_roll_t chrgroll = { + .name = THR_NAME_ROLL, + .tid = RT_NULL, + .idx = 0, + .en_nor = {1, 1, 1, 1}, + .en_sou = {1, 1, 1, 1, 0, 0, 0, 0}, +}; + +rt_uint8_t chrg_roll_get_idx (void) +{ + rt_uint8_t idx = 0; + struct chrg_roll_t *pROLL = &chrgroll; + + rt_mutex_take(pROLL->mutex, RT_WAITING_FOREVER); + idx = pROLL->idx; + rt_mutex_release(pROLL->mutex); + + return idx; +} + +void chrg_roll_evt_send (void) +{ + struct chrg_roll_t *pROLL = &chrgroll; + if (RT_NULL != pROLL->evt) { + rt_event_send(pROLL->evt, ROLL_EVT_RECVED); + } +} + +static void chrg_roll_thread_entry (void *data) +{ + struct chrg_roll_t *pROLL = (struct chrg_roll_t *)data; + + if (RT_NULL == pROLL) { + return ; + } + + rt_uint8_t idx = 0; + rt_err_t ret = RT_EOK; + rt_uint32_t recved = 0; + struct chrg_north_t *pNOR = &chrgnorth; + struct chrg_south_t *pSOU = &chrgsouth; + struct chrg_switch_t *pSW = RT_NULL; + + while (1) { + rt_mutex_take(pROLL->mutex, RT_WAITING_FOREVER); + pROLL->idx = idx%(TOTAL_CHS+TOTAL_SOUTH_CHS); + rt_mutex_release(pROLL->mutex); + + if (pROLL->idx < TOTAL_CHS) { + if (0 == pROLL->en_nor[pROLL->idx]) { + idx++; + rt_thread_mdelay(1); + continue; + } else { + pNOR->idx = (eIDX_CH)pROLL->idx; + chrg_switch_north(pNOR->idx); + + pSW = &pNOR->sw[pNOR->idx]; + if (ID_SOURCE == pSW->id) { + source_get_vc(pSW->source.voltage, pSW->source.current); + } else if (ID_SINK == pSW->id) { + sink_get_vc(pSW->sink.loadv, pSW->sink.loadc); + } + } + } else { + if (0 == pROLL->en_sou[pROLL->idx]) { + idx++; + rt_thread_mdelay(1); + continue; + } else { + pSOU->idx = (eIDX_SOUTH_CH)(pROLL->idx - TOTAL_CHS); + chrg_switch_south(pSOU->idx); + + pSW = &pSOU->sw[pSOU->idx]; + if (ID_SOURCE == pSW->id) { + source_get_vc(pSW->source.voltage, pSW->source.current); + } else if (ID_SINK == pSW->id) { + sink_get_vc(pSW->sink.loadv, pSW->sink.loadc); + } + + } + } + + idx++; + + ret = rt_event_recv(pROLL->evt, ROLL_EVT_RECVED, + (RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR), 100, &recved); // wait 100ms + if (RT_EOK != ret) { + //LOG_E("evt recv failed. [%d]", ret); + continue; + } + + if (recved & ROLL_EVT_RECVED) { + + } + } + +} + +static int chrg_roll_init (void) +{ + struct chrg_roll_t *pROLL = &chrgroll; + + pROLL->mutex = rt_mutex_create(pROLL->name, RT_IPC_FLAG_FIFO); + if (RT_NULL == pROLL->mutex) { + LOG_E("create mutex '%s' failed.", pROLL->name); + return -RT_ERROR; + } + + pROLL->evt = rt_event_create(pROLL->name, RT_IPC_FLAG_FIFO); + if (RT_NULL == pROLL->evt) { + LOG_E("create ev '%s' failed.", pROLL->name); + return -RT_ERROR; + } + + pROLL->tid = rt_thread_create(pROLL->name, chrg_roll_thread_entry, pROLL, 2048, + RT_MAIN_THREAD_PRIORITY, 20); + if (RT_NULL != pROLL->tid) { + rt_thread_startup(pROLL->tid); + } else { + LOG_E("create thread '%s' failed.", pROLL->name); + } + + return RT_EOK; +} + + +INIT_APP_EXPORT(chrg_roll_init); + + + + diff --git a/apps/chrg/applications/thread/chrg_roll.h b/apps/chrg/applications/thread/chrg_roll.h new file mode 100644 index 0000000..9bba6fb --- /dev/null +++ b/apps/chrg/applications/thread/chrg_roll.h @@ -0,0 +1,34 @@ +#ifndef __CHRG_ROLL_H__ +#define __CHRG_ROLL_H__ + +#include + +#include "chrg_switch.h" + +#define THR_NAME_ROLL "thr.roll" + +#define ROLL_EVT_RECVED (1<<0) // 收到数据 + + +struct chrg_roll_t { + const char *name; + struct rt_thread *tid; + + rt_mutex_t mutex; + rt_event_t evt; + + rt_uint8_t idx; // 轮巡索引 0-3:nor 4-11:sou + + rt_uint8_t en_nor[TOTAL_CHS]; // 北向通路使能 + rt_uint8_t en_sou[TOTAL_SOUTH_CHS]; // 南向通路使能 +}; + +extern struct chrg_roll_t chrgroll; + +extern rt_uint8_t chrg_roll_get_idx (void); + +extern void chrg_roll_evt_send (void); + + +#endif + diff --git a/apps/chrg/applications/thread/chrg_south.c b/apps/chrg/applications/thread/chrg_south.c index 8c9c0ef..60bf2c6 100644 --- a/apps/chrg/applications/thread/chrg_south.c +++ b/apps/chrg/applications/thread/chrg_south.c @@ -2,7 +2,7 @@ #include #include "chrg_south.h" - +#include "chrg_roll.h" #include "chrg_utils.h" #define LOG_TAG "chrg.sou" @@ -53,9 +53,13 @@ static void chrg_south_thread_entry (void *data) continue; } + // pick data & update sw + //rt_kprintf("%s\r\n", (char *)pSOU->rx_buf); //chrg_tty_send(pTTY, pSOU->rx_buf, len); + chrg_roll_evt_send(); + } diff --git a/apps/chrg/applications/thread/chrg_south.h b/apps/chrg/applications/thread/chrg_south.h index f9e1d10..bd25763 100644 --- a/apps/chrg/applications/thread/chrg_south.h +++ b/apps/chrg/applications/thread/chrg_south.h @@ -19,6 +19,7 @@ struct chrg_south_t { rt_uint16_t rx_len; rt_uint8_t rx_buf[SIZE_BUF_TTY]; + eIDX_SOUTH_CH idx; // 当前通路 struct chrg_switch_t sw[TOTAL_SOUTH_CHS]; }; diff --git a/apps/chrg/applications/utils/chrg_sink.c b/apps/chrg/applications/utils/chrg_sink.c index e1d9ced..c329f75 100644 --- a/apps/chrg/applications/utils/chrg_sink.c +++ b/apps/chrg/applications/utils/chrg_sink.c @@ -1,4 +1,11 @@ #include "chrg_sink.h" +int sink_get_vc (rt_uint16_t vol, rt_uint16_t cur) +{ + + return 0; +} + + diff --git a/apps/chrg/applications/utils/chrg_sink.h b/apps/chrg/applications/utils/chrg_sink.h index 66344f8..409d04d 100644 --- a/apps/chrg/applications/utils/chrg_sink.h +++ b/apps/chrg/applications/utils/chrg_sink.h @@ -142,7 +142,7 @@ struct chrg_sink_t { rt_uint8_t cc_lvl; // 设置CC线电平等级(0-10,默认7) }; - +extern int sink_get_vc (rt_uint16_t vol, rt_uint16_t cur); #endif diff --git a/apps/chrg/applications/utils/chrg_source.h b/apps/chrg/applications/utils/chrg_source.h index 0ea0f1c..27212b9 100644 --- a/apps/chrg/applications/utils/chrg_source.h +++ b/apps/chrg/applications/utils/chrg_source.h @@ -85,7 +85,7 @@ struct chrg_src_t { }; - +extern int source_get_vc (rt_uint16_t vol, rt_uint16_t cur); #endif diff --git a/apps/chrg/applications/utils/chrg_utils.c b/apps/chrg/applications/utils/chrg_utils.c index 9edbefc..6aa0e6e 100644 --- a/apps/chrg/applications/utils/chrg_utils.c +++ b/apps/chrg/applications/utils/chrg_utils.c @@ -53,7 +53,7 @@ static const rt_uint8_t aucCRCLo[] = { 0x41, 0x81, 0x80, 0x40 }; -rt_uint16_t usMBCRC16 (rt_uint8_t *pucFrame, rt_uint16_t usLen) +rt_uint16_t mb_crc16 (rt_uint8_t *pucFrame, rt_uint16_t usLen) { rt_uint8_t ucCRCHi = 0xFF; rt_uint8_t ucCRCLo = 0xFF; diff --git a/apps/chrg/applications/utils/chrg_utils.h b/apps/chrg/applications/utils/chrg_utils.h index 156d60d..e41e281 100644 --- a/apps/chrg/applications/utils/chrg_utils.h +++ b/apps/chrg/applications/utils/chrg_utils.h @@ -3,7 +3,7 @@ #include -extern rt_uint16_t usMBCRC16 (rt_uint8_t * pucFrame, rt_uint16_t usLen); +extern rt_uint16_t mb_crc16 (rt_uint8_t * pucFrame, rt_uint16_t usLen); extern rt_uint8_t calc_crc8 (rt_uint8_t *data, rt_uint8_t length); diff --git a/apps/chrg/chrg.uvprojx b/apps/chrg/chrg.uvprojx index 8d78520..f31448a 100644 --- a/apps/chrg/chrg.uvprojx +++ b/apps/chrg/chrg.uvprojx @@ -53,7 +53,7 @@ 1 0 1 - 0 + 1 0 .\build\keil\List\ 1 @@ -313,7 +313,7 @@ 1 - 1 + 0 0 0 1 @@ -328,8 +328,8 @@ 1 0 0 - 3 - 3 + 1 + 1 1 1 0 @@ -337,9 +337,9 @@ 0 - __STDC_LIMIT_MACROS, RT_USING_LIBC, RT_USING_ARMLIBC, USE_HAL_DRIVER, STM32F405xx, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND + STM32F405xx, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, USE_HAL_DRIVER, __STDC_LIMIT_MACROS, __RTTHREAD__, RT_USING_LIBC - ..\..\rt-thread\components\drivers\phy;..\..\rt-thread\components\drivers\include;applications\thread;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\..\rt-thread\libcpu\arm\common;applications;..\..\rt-thread\components\libc\compilers\common\extension;..\..\rt-thread\components\drivers\include;.;applications\utils;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\include;board\ports;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;..\..\libs\stm32f4\STM32F4_HAL\Inc;..\..\rt-thread\components\libc\posix\ipc;..\..\rt-thread\components\libc\compilers\common\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\components\libc\posix\io\epoll;board\CubeMX_Config\Inc;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;..\..\rt-thread\components\finsh;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\smp_call;..\..\rt-thread\libcpu\arm\cortex-m4;..\..\rt-thread\components\libc\posix\io\poll;..\..\rt-thread\components\fal\inc;..\..\libs\cmsis-core\Include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\io\eventfd;applications\bsp;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;board;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include + ..\..\rt-thread\components\libc\posix\io\eventfd;board\ports;..\..\libs\cmsis-core\Include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\components\finsh;..\..\rt-thread\components\libc\compilers\common\extension;..\..\rt-thread\components\libc\compilers\common\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;..\..\rt-thread\libcpu\arm\common;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\ipc;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\phy;applications\utils;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;applications\thread;applications\bsp;applications;..\..\rt-thread\include;board;..\..\rt-thread\libcpu\arm\cortex-m4;..\..\rt-thread\components\libc\posix\io\epoll;..\..\rt-thread\components\drivers\include;.;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\components\drivers\smp_call;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc;..\..\rt-thread\components\libc\posix\io\poll;..\..\rt-thread\components\fal\inc;board\CubeMX_Config\Inc;..\..\rt-thread\components\drivers\include @@ -393,65 +393,75 @@ Applications/bsp - - chrg_switch.c - 1 - applications\bsp\chrg_switch.c - - - chrg_tty.c - 1 - applications\bsp\chrg_tty.c - chrg_pin.c 1 applications\bsp\chrg_pin.c - - chrg_can.c - 1 - applications\bsp\chrg_can.c - - - chrg_fal.c - 1 - applications\bsp\chrg_fal.c - - - chrg_intr.c - 1 - applications\bsp\chrg_intr.c - - - chrg_tmr.c - 1 - applications\bsp\chrg_tmr.c - - - chrg_wdt.c - 1 - applications\bsp\chrg_wdt.c - chrg_clk.c 1 applications\bsp\chrg_clk.c + + chrg_switch.c + 1 + applications\bsp\chrg_switch.c + chrg_i2c.c 1 applications\bsp\chrg_i2c.c + + chrg_fal.c + 1 + applications\bsp\chrg_fal.c + + + chrg_tmr.c + 1 + applications\bsp\chrg_tmr.c + + + chrg_can.c + 1 + applications\bsp\chrg_can.c + + + chrg_intr.c + 1 + applications\bsp\chrg_intr.c + + + chrg_tty.c + 1 + applications\bsp\chrg_tty.c + + + chrg_wdt.c + 1 + applications\bsp\chrg_wdt.c + Applications/thread - chrg_lcd.c + chrg_north.c 1 - applications\thread\chrg_lcd.c + applications\thread\chrg_north.c + + + chrg_roll.c + 1 + applications\thread\chrg_roll.c + + + chrg_south.c + 1 + applications\thread\chrg_south.c chrg_comm.c @@ -459,14 +469,9 @@ applications\thread\chrg_comm.c - chrg_north.c + chrg_lcd.c 1 - applications\thread\chrg_north.c - - - chrg_south.c - 1 - applications\thread\chrg_south.c + applications\thread\chrg_lcd.c @@ -479,25 +484,25 @@ applications\utils\chrg_source.c - chrg_sink.c + chrg_pcf8574.c 1 - applications\utils\chrg_sink.c + applications\utils\chrg_pcf8574.c chrg_utils.c 1 applications\utils\chrg_utils.c - - chrg_pcf8574.c - 1 - applications\utils\chrg_pcf8574.c - chrg_pkg.c 1 applications\utils\chrg_pkg.c + + chrg_sink.c + 1 + applications\utils\chrg_sink.c + @@ -1621,16 +1626,16 @@ 1 ..\..\rt-thread\components\fal\src\fal_partition.c - - fal_flash.c - 1 - ..\..\rt-thread\components\fal\src\fal_flash.c - fal.c 1 ..\..\rt-thread\components\fal\src\fal.c + + fal_flash.c + 1 + ..\..\rt-thread\components\fal\src\fal_flash.c + fal_rtt.c 1 @@ -1641,6 +1646,11 @@ Finsh + + cmd.c + 1 + ..\..\rt-thread\components\finsh\cmd.c + msh.c 1 @@ -1656,11 +1666,6 @@ 1 ..\..\rt-thread\components\finsh\shell.c - - cmd.c - 1 - ..\..\rt-thread\components\finsh\cmd.c - @@ -2511,11 +2516,6 @@ klibc - - kstring.c - 1 - ..\..\rt-thread\src\klibc\kstring.c - kstdio.c 1 @@ -2526,16 +2526,21 @@ 1 ..\..\rt-thread\src\klibc\rt_vsscanf.c - - rt_vsnprintf_tiny.c - 1 - ..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c - kerrno.c 1 ..\..\rt-thread\src\klibc\kerrno.c + + kstring.c + 1 + ..\..\rt-thread\src\klibc\kstring.c + + + rt_vsnprintf_tiny.c + 1 + ..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c + @@ -2571,65 +2576,120 @@ STM32F4-CMSIS - - startup_stm32f405xx.s - 2 - ..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\arm\startup_stm32f405xx.s - system_stm32f4xx.c 1 ..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\system_stm32f4xx.c + + startup_stm32f405xx.s + 2 + ..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\arm\startup_stm32f405xx.s + STM32F4-HAL - stm32f4xx_hal_i2c.c + stm32f4xx_hal_gpio.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c - - - stm32f4xx_hal_cec.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c - - - stm32f4xx_hal_uart.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_uart.c - - - stm32f4xx_hal_i2c_ex.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c stm32f4xx_hal_lptim.c 1 ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_lptim.c + + stm32f4xx_hal_flash_ex.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c + + + stm32f4xx_hal_can.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c + + + stm32f4xx_hal_cryp.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c + + + stm32f4xx_hal_rcc.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c + + + stm32f4xx_hal_rng.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c + + + stm32f4xx_hal_dma_ex.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c + + + stm32f4xx_hal_tim.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c + stm32f4xx_hal_flash.c 1 ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash.c + + stm32f4xx_hal_pwr.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c + + + stm32f4xx_hal_cortex.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cortex.c + + + stm32f4xx_hal_iwdg.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c + + + stm32f4xx_hal_dma.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c + + + stm32f4xx_hal_uart.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_uart.c + + + stm32f4xx_hal_cryp_ex.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c + stm32f4xx_hal_rcc_ex.c 1 ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc_ex.c - stm32f4xx_hal_flash_ex.c + stm32f4xx_hal_i2c_ex.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c - stm32f4xx_hal_pwr_ex.c + stm32f4xx_hal_usart.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr_ex.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c + + + stm32f4xx_hal_crc.c + 1 + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_crc.c stm32f4xx_hal_tim_ex.c @@ -2642,14 +2702,9 @@ ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ramfunc.c - stm32f4xx_hal_rng.c + stm32f4xx_hal_i2c.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c - - - stm32f4xx_hal_cortex.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cortex.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c stm32f4xx_hal.c @@ -2657,39 +2712,9 @@ ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal.c - stm32f4xx_hal_can.c + stm32f4xx_hal_pwr_ex.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c - - - stm32f4xx_hal_iwdg.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c - - - stm32f4xx_hal_usart.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c - - - stm32f4xx_hal_dma_ex.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c - - - stm32f4xx_hal_pwr.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c - - - stm32f4xx_hal_crc.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_crc.c - - - stm32f4xx_hal_tim.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr_ex.c stm32f4xx_hal_wwdg.c @@ -2697,29 +2722,9 @@ ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_wwdg.c - stm32f4xx_hal_gpio.c + stm32f4xx_hal_cec.c 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c - - - stm32f4xx_hal_dma.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c - - - stm32f4xx_hal_cryp_ex.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c - - - stm32f4xx_hal_rcc.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c - - - stm32f4xx_hal_cryp.c - 1 - ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c + ..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c