Минорные изменения

This commit is contained in:
2026-05-25 14:07:11 +03:00
parent 7f116acf22
commit 8ffba3b9e0
10 changed files with 171 additions and 85 deletions

View File

@@ -278,10 +278,10 @@ PROTOCAN_INIT_StatusTypeDef PROTOCAN_INIT(CAN_HandleTypeDef *tmp_hcan,
RTC_HandleTypeDef *tmp_hrtc, RTC_HandleTypeDef *tmp_hrtc,
TIM_HandleTypeDef *tmp_tim); TIM_HandleTypeDef *tmp_tim);
void PROTOCAN_DEINIT(uint8_t stage); void PROTOCAN_DEINIT(uint8_t stage);
void ProtoCanPulseCallback(TIM_HandleTypeDef *htim);
void ProtoCanRxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void PROTOCAN_FILTERS(void); void PROTOCAN_FILTERS(void);
void PROTOCAN_LOOP(void); void PROTOCAN_LOOP(void);
void ProtoCanPulseCallback(TIM_HandleTypeDef *htim);
void ProtoCanRxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef PROTOCAN_AnalogProcessing(struct RXMsg _rxMsg); HAL_StatusTypeDef PROTOCAN_AnalogProcessing(struct RXMsg _rxMsg);
HAL_StatusTypeDef ProtoCanMsgToAnalogUniversal(struct RXMsg _rxMsg); HAL_StatusTypeDef ProtoCanMsgToAnalogUniversal(struct RXMsg _rxMsg);

View File

@@ -637,13 +637,18 @@ void PROTOCAN_GeneralAddressSpace_Answer(struct RXMsg _rxMsg)
data[1] = 'A'; data[1] = 'A';
data[2] = 'S'; data[2] = 'S';
data[3] = '-'; data[3] = '-';
for(int i = 0; i < 4; i++) { for(int i = 0; i < 4; i++)
{
unsigned sym = (_rxMsg.eID.Fields.MsgBody>>(12-(i*4)))&0xF; unsigned sym = (_rxMsg.eID.Fields.MsgBody>>(12-(i*4)))&0xF;
if(sym >= 10) if(sym >= 10)
{
data[4+i] = sym%10+'A'; data[4+i] = sym%10+'A';
}
else else
{
data[4+i] = sym+'0'; data[4+i] = sym+'0';
} }
}
HAL_CAN_AddTxMessage(_HCAN, &TxHeader, data, &TxMailBox); HAL_CAN_AddTxMessage(_HCAN, &TxHeader, data, &TxMailBox);
} }
@@ -931,7 +936,8 @@ void ProtoCanPulseCallback(TIM_HandleTypeDef *htim)
PulseStage++; PulseStage++;
unsigned int debugID; unsigned int debugID;
debugID = currentID.BitAll; debugID = currentID.BitAll;
if(PulseStage > 0xFF){ if(PulseStage > 0xFF)
{
PulseStage = 0; PulseStage = 0;
} }
data[0] = PulseStage; data[0] = PulseStage;
@@ -987,10 +993,10 @@ void PROTOCAN_CONFIG_FILTER(uint8_t filterBank, uint32_t idFilter, uint32_t idMa
canFilterConfig.SlaveStartFilterBank = 14; canFilterConfig.SlaveStartFilterBank = 14;
// Разбиваем 32-битный ID и маску для фильтрации на High и Low 16 бит // Разбиваем 32-битный ID и маску для фильтрации на High и Low 16 бит
canFilterConfig.FilterIdHigh = (uint16_t)( ((idFilter) >> 13) ); // верхние 16 бит canFilterConfig.FilterIdHigh = (uint16_t)(((idFilter) >> 13)); // верхние 16 бит
canFilterConfig.FilterIdLow = (uint16_t)( (((idFilter) << 3) ) | CAN_IDE_32 ); // низкие 16 бит, canFilterConfig.FilterIdLow = (uint16_t)((((idFilter) << 3)) | CAN_IDE_32); // низкие 16 бит,
canFilterConfig.FilterMaskIdHigh = (uint16_t)(((idMask) >> 13) ); canFilterConfig.FilterMaskIdHigh = (uint16_t)(((idMask) >> 13));
canFilterConfig.FilterMaskIdLow = (uint16_t)( (((idMask) << 3) ) | CAN_IDE_32 ); canFilterConfig.FilterMaskIdLow = (uint16_t)((((idMask) << 3)) | CAN_IDE_32);
if(HAL_CAN_ConfigFilter(_HCAN, &canFilterConfig) != HAL_OK) if(HAL_CAN_ConfigFilter(_HCAN, &canFilterConfig) != HAL_OK)
{ {

File diff suppressed because one or more lines are too long

View File

@@ -341,6 +341,70 @@
<ExecCommand></ExecCommand> <ExecCommand></ExecCommand>
<Expression></Expression> <Expression></Expression>
</Bp> </Bp>
<Bp>
<Number>12</Number>
<Type>0</Type>
<LineNumber>700</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\Core\Src\protocan.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>13</Number>
<Type>0</Type>
<LineNumber>701</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\Core\Src\protocan.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>14</Number>
<Type>0</Type>
<LineNumber>738</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\Core\Src\protocan.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>15</Number>
<Type>0</Type>
<LineNumber>739</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\Core\Src\protocan.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint> </Breakpoint>
<WatchWindow1> <WatchWindow1>
<Ww> <Ww>
@@ -529,7 +593,7 @@
<GroupNumber>2</GroupNumber> <GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber> <FileNumber>6</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>../Core/Src/main.c</PathWithFileName> <PathWithFileName>../Core/Src/main.c</PathWithFileName>

Binary file not shown.

View File

@@ -27,8 +27,15 @@ Project File Date: 03/31/2026
<h2>Output:</h2> <h2>Output:</h2>
*** Using Compiler 'V6.19', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' *** Using Compiler 'V6.19', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
Build target 'F103C8T6' Build target 'F103C8T6'
compiling stm32f1xx_it.c... compiling gpio.c...
compiling tim.c...
compiling rtc.c...
compiling canerrorbox.c...
compiling can.c...
compiling main.c... compiling main.c...
compiling protocan.c...
compiling stm32f1xx_hal_msp.c...
compiling stm32f1xx_it.c...
linking... linking...
Program Size: Code=25152 RO-data=424 RW-data=36 ZI-data=6668 Program Size: Code=25152 RO-data=424 RW-data=36 ZI-data=6668
FromELF: creating hex file... FromELF: creating hex file...

View File

@@ -3,7 +3,7 @@
<title>Static Call Graph - [F103C8T6\F103C8T6.axf]</title></head> <title>Static Call Graph - [F103C8T6\F103C8T6.axf]</title></head>
<body><HR> <body><HR>
<H1>Static Call Graph for image F103C8T6\F103C8T6.axf</H1><HR> <H1>Static Call Graph for image F103C8T6\F103C8T6.axf</H1><HR>
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6190004: Last Updated: Tue Mar 31 11:51:31 2026 <BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6190004: Last Updated: Fri May 22 12:54:05 2026
<BR><P> <BR><P>
<H3>Maximum Stack Usage = 320 bytes + Unknown(Functions without stacksize, Cycles, Untraceable Function Pointers)</H3><H3> <H3>Maximum Stack Usage = 320 bytes + Unknown(Functions without stacksize, Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3> Call chain for Maximum Stack Depth:</H3>

View File

@@ -3184,7 +3184,7 @@ Image component sizes
766 0 0 0 88 5873 canerrorbox.o 766 0 0 0 88 5873 canerrorbox.o
74 0 0 0 0 1313 gpio.o 74 0 0 0 0 1313 gpio.o
260 0 0 0 0 1881 main.o 260 0 0 0 0 1881 main.o
5876 0 96 21 4633 21002 protocan.o 5876 0 96 21 4633 21004 protocan.o
224 0 0 0 20 2491 rtc.o 224 0 0 0 20 2491 rtc.o
64 26 236 0 1536 772 startup_stm32f103xb.o 64 26 236 0 1536 772 startup_stm32f103xb.o
188 0 0 5 4 5530 stm32f1xx_hal.o 188 0 0 5 4 5530 stm32f1xx_hal.o
@@ -3203,7 +3203,7 @@ Image component sizes
264 0 0 0 180 6554 tim.o 264 0 0 0 180 6554 tim.o
---------------------------------------------------------------------- ----------------------------------------------------------------------
24696 26 424 36 6572 160256 Object Totals 24696 26 424 36 6572 160258 Object Totals
0 0 32 0 0 0 (incl. Generated) 0 0 32 0 0 0 (incl. Generated)
130 0 0 6 11 0 (incl. Padding) 130 0 0 6 11 0 (incl. Padding)
@@ -3254,8 +3254,8 @@ Image component sizes
Code (inc. data) RO Data RW Data ZI Data Debug Code (inc. data) RO Data RW Data ZI Data Debug
25152 42 424 36 6668 160408 Grand Totals 25152 42 424 36 6668 160410 Grand Totals
25152 42 424 36 6668 160408 ELF Image Totals 25152 42 424 36 6668 160410 ELF Image Totals
25152 42 424 36 0 0 ROM Totals 25152 42 424 36 0 0 ROM Totals
============================================================================== ==============================================================================

File diff suppressed because one or more lines are too long

Binary file not shown.