This commit is contained in:
yxming66 2025-12-10 20:18:07 +08:00
parent e19c72e187
commit fe5d758b1d
154 changed files with 11062 additions and 8488 deletions

View File

@ -34,14 +34,11 @@ extern "C" {
extern TIM_HandleTypeDef htim1;
extern TIM_HandleTypeDef htim2;
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_TIM1_Init(void);
void MX_TIM2_Init(void);
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

View File

@ -98,7 +98,6 @@ int main(void)
MX_TIM1_Init();
MX_USART1_UART_Init();
MX_USART2_UART_Init();
MX_TIM2_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */

View File

@ -62,7 +62,7 @@ extern DMA_HandleTypeDef hdma_spi1_rx;
extern DMA_HandleTypeDef hdma_spi2_tx;
extern SPI_HandleTypeDef hspi1;
extern SPI_HandleTypeDef hspi2;
extern DMA_HandleTypeDef hdma_usart1_tx;
extern DMA_HandleTypeDef hdma_tim1_ch4_trig_com;
extern DMA_HandleTypeDef hdma_usart2_rx;
extern DMA_HandleTypeDef hdma_usart2_tx;
extern UART_HandleTypeDef huart1;
@ -227,7 +227,7 @@ void DMA1_Channel4_IRQHandler(void)
/* USER CODE BEGIN DMA1_Channel4_IRQn 0 */
/* USER CODE END DMA1_Channel4_IRQn 0 */
HAL_DMA_IRQHandler(&hdma_usart1_tx);
HAL_DMA_IRQHandler(&hdma_tim1_ch4_trig_com);
/* USER CODE BEGIN DMA1_Channel4_IRQn 1 */
/* USER CODE END DMA1_Channel4_IRQn 1 */

View File

@ -25,7 +25,7 @@
/* USER CODE END 0 */
TIM_HandleTypeDef htim1;
TIM_HandleTypeDef htim2;
DMA_HandleTypeDef hdma_tim1_ch4_trig_com;
/* TIM1 init function */
void MX_TIM1_Init(void)
@ -46,7 +46,7 @@ void MX_TIM1_Init(void)
htim1.Instance = TIM1;
htim1.Init.Prescaler = 0;
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
htim1.Init.Period = 65535;
htim1.Init.Period = 90-1;
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
@ -95,46 +95,6 @@ void MX_TIM1_Init(void)
/* USER CODE END TIM1_Init 2 */
HAL_TIM_MspPostInit(&htim1);
}
/* TIM2 init function */
void MX_TIM2_Init(void)
{
/* USER CODE BEGIN TIM2_Init 0 */
/* USER CODE END TIM2_Init 0 */
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
TIM_MasterConfigTypeDef sMasterConfig = {0};
/* USER CODE BEGIN TIM2_Init 1 */
/* USER CODE END TIM2_Init 1 */
htim2.Instance = TIM2;
htim2.Init.Prescaler = 0;
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
htim2.Init.Period = 65535;
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM2_Init 2 */
/* USER CODE END TIM2_Init 2 */
}
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
@ -147,21 +107,32 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
/* USER CODE END TIM1_MspInit 0 */
/* TIM1 clock enable */
__HAL_RCC_TIM1_CLK_ENABLE();
/* TIM1 DMA Init */
/* TIM1_CH4_TRIG_COM Init */
hdma_tim1_ch4_trig_com.Instance = DMA1_Channel4;
hdma_tim1_ch4_trig_com.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_tim1_ch4_trig_com.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_tim1_ch4_trig_com.Init.MemInc = DMA_MINC_ENABLE;
hdma_tim1_ch4_trig_com.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_tim1_ch4_trig_com.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_tim1_ch4_trig_com.Init.Mode = DMA_NORMAL;
hdma_tim1_ch4_trig_com.Init.Priority = DMA_PRIORITY_LOW;
if (HAL_DMA_Init(&hdma_tim1_ch4_trig_com) != HAL_OK)
{
Error_Handler();
}
/* Several peripheral DMA handle pointers point to the same DMA handle.
Be aware that there is only one channel to perform all the requested DMAs. */
__HAL_LINKDMA(tim_baseHandle,hdma[TIM_DMA_ID_CC4],hdma_tim1_ch4_trig_com);
__HAL_LINKDMA(tim_baseHandle,hdma[TIM_DMA_ID_TRIGGER],hdma_tim1_ch4_trig_com);
__HAL_LINKDMA(tim_baseHandle,hdma[TIM_DMA_ID_COMMUTATION],hdma_tim1_ch4_trig_com);
/* USER CODE BEGIN TIM1_MspInit 1 */
/* USER CODE END TIM1_MspInit 1 */
}
else if(tim_baseHandle->Instance==TIM2)
{
/* USER CODE BEGIN TIM2_MspInit 0 */
/* USER CODE END TIM2_MspInit 0 */
/* TIM2 clock enable */
__HAL_RCC_TIM2_CLK_ENABLE();
/* USER CODE BEGIN TIM2_MspInit 1 */
/* USER CODE END TIM2_MspInit 1 */
}
}
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle)
{
@ -199,21 +170,15 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
/* USER CODE END TIM1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM1_CLK_DISABLE();
/* TIM1 DMA DeInit */
HAL_DMA_DeInit(tim_baseHandle->hdma[TIM_DMA_ID_CC4]);
HAL_DMA_DeInit(tim_baseHandle->hdma[TIM_DMA_ID_TRIGGER]);
HAL_DMA_DeInit(tim_baseHandle->hdma[TIM_DMA_ID_COMMUTATION]);
/* USER CODE BEGIN TIM1_MspDeInit 1 */
/* USER CODE END TIM1_MspDeInit 1 */
}
else if(tim_baseHandle->Instance==TIM2)
{
/* USER CODE BEGIN TIM2_MspDeInit 0 */
/* USER CODE END TIM2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM2_CLK_DISABLE();
/* USER CODE BEGIN TIM2_MspDeInit 1 */
/* USER CODE END TIM2_MspDeInit 1 */
}
}
/* USER CODE BEGIN 1 */

View File

@ -23,13 +23,14 @@
/* USER CODE BEGIN 0 */
#include "string.h"
#include <stdio.h>
#include <stdbool.h>
uint8_t uart_buffer[255],uart2_data[255],uart2_datalength;
bool uart2_data_ready=false;
/* USER CODE END 0 */
UART_HandleTypeDef huart1;
UART_HandleTypeDef huart2;
DMA_HandleTypeDef hdma_usart1_tx;
DMA_HandleTypeDef hdma_usart2_rx;
DMA_HandleTypeDef hdma_usart2_tx;
@ -87,7 +88,10 @@ void MX_USART2_UART_Init(void)
Error_Handler();
}
/* USER CODE BEGIN USART2_Init 2 */
/* 启动UART2 DMA接收 - 修复第一次命令不触发的问题 */
HAL_UART_Receive_DMA(&huart2, (uint8_t*)uart_buffer, 255);
/* 使能UART2空闲中断 */
__HAL_UART_ENABLE_IT(&huart2, UART_IT_IDLE);
/* USER CODE END USART2_Init 2 */
}
@ -119,23 +123,6 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USART1 DMA Init */
/* USART1_TX Init */
hdma_usart1_tx.Instance = DMA1_Channel4;
hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_usart1_tx.Init.Mode = DMA_NORMAL;
hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
{
Error_Handler();
}
__HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx);
/* USART1 interrupt Init */
HAL_NVIC_SetPriority(USART1_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(USART1_IRQn);
@ -225,9 +212,6 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
/* USART1 DMA DeInit */
HAL_DMA_DeInit(uartHandle->hdmatx);
/* USART1 interrupt Deinit */
HAL_NVIC_DisableIRQ(USART1_IRQn);
/* USER CODE BEGIN USART1_MspDeInit 1 */
@ -261,8 +245,7 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
}
/* USER CODE BEGIN 1 */
uint8_t uart_buffer[255],uart2_data[255],uart2_datalength;
__weak void MR16_NotifyUARTIdle(void) { }
void USAR_UART2_IDLECallback(UART_HandleTypeDef *huart)
{
if (huart == NULL) return;
@ -272,16 +255,20 @@ void USAR_UART2_IDLECallback(UART_HandleTypeDef *huart)
uart2_datalength = 255 - __HAL_DMA_GET_COUNTER(&hdma_usart2_rx); // 计算接收长度(针对 USART2
printf("[UART2 RX:%d] ", uart2_datalength);
HAL_UART_Transmit(huart, uart_buffer, uart2_datalength, 0x200); // 回显/打印接收数据
printf("\r\n");
strcpy((char*)uart2_data,(char*)uart_buffer);
memset(uart_buffer, 0, uart2_datalength); // 清空已读数据
HAL_UART_Receive_DMA(huart, (uint8_t*)uart_buffer, 255); // 重启 DMA 接收
if (uart2_datalength > 0 && uart2_datalength < 255) {
printf("[UART2 RX:%d] ", uart2_datalength);
HAL_UART_Transmit(huart, uart_buffer, uart2_datalength, 0x200); // 回显/打印接收数据
printf("\r\n");
/* 只有在上次数据处理完后才复制新数据,防止覆盖 */
if (!uart2_data_ready) {
memcpy(uart2_data, uart_buffer, uart2_datalength);
uart2_data_ready = true; /* 标记数据就绪 */
}
}
MR16_NotifyUARTIdle();
memset(uart_buffer, 0, sizeof(uart_buffer)); // 清空缓冲区
HAL_UART_Receive_DMA(huart, (uint8_t*)uart_buffer, 255); // 重启 DMA 接收
}
void USER_UART_IRQHandler(UART_HandleTypeDef *huart)

File diff suppressed because one or more lines are too long

View File

@ -148,7 +148,56 @@
<Name>-U7 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL010000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>265</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134243338</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\User\module\mr16.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\MR16\../User/module/mr16.c\265</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>273</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134243364</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\User\module\mr16.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\MR16\../User/module/mr16.c\273</Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>298</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134243446</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\User\module\mr16.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\MR16\../User/module/mr16.c\298</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
@ -183,7 +232,7 @@
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>robot_config,0x10</ItemText>
<ItemText>robot_config,0x0A</ItemText>
</Ww>
<Ww>
<count>7</count>
@ -195,6 +244,11 @@
<WinNumber>1</WinNumber>
<ItemText>tmp,0x0A</ItemText>
</Ww>
<Ww>
<count>9</count>
<WinNumber>1</WinNumber>
<ItemText>radioRXSize,0x0A</ItemText>
</Ww>
</WatchWindow1>
<WatchWindow2>
<Ww>
@ -288,7 +342,7 @@
<Group>
<GroupName>Application/User/Core</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -320,7 +374,7 @@
<GroupNumber>2</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>../Core/Src/freertos.c</PathWithFileName>
@ -876,6 +930,30 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\bsp\pwm.c</PathWithFileName>
<FilenameWithoutPath>pwm.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>49</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\bsp\pwm.h</PathWithFileName>
<FilenameWithoutPath>pwm.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -886,7 +964,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>48</FileNumber>
<FileNumber>50</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -898,7 +976,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>49</FileNumber>
<FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -910,7 +988,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>50</FileNumber>
<FileNumber>52</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -922,7 +1000,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>51</FileNumber>
<FileNumber>53</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -932,6 +1010,30 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>54</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\device\ws2812.c</PathWithFileName>
<FilenameWithoutPath>ws2812.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>55</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\device\ws2812.h</PathWithFileName>
<FilenameWithoutPath>ws2812.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -942,7 +1044,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>52</FileNumber>
<FileNumber>56</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -954,7 +1056,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>53</FileNumber>
<FileNumber>57</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -966,7 +1068,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>54</FileNumber>
<FileNumber>58</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -978,7 +1080,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>55</FileNumber>
<FileNumber>59</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -990,7 +1092,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>56</FileNumber>
<FileNumber>60</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1002,7 +1104,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>57</FileNumber>
<FileNumber>61</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1014,7 +1116,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>58</FileNumber>
<FileNumber>62</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1026,7 +1128,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>59</FileNumber>
<FileNumber>63</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1038,7 +1140,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>60</FileNumber>
<FileNumber>64</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1050,7 +1152,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>61</FileNumber>
<FileNumber>65</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1062,7 +1164,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>62</FileNumber>
<FileNumber>66</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1074,7 +1176,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>63</FileNumber>
<FileNumber>67</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1086,7 +1188,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>64</FileNumber>
<FileNumber>68</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1098,7 +1200,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>65</FileNumber>
<FileNumber>69</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1110,7 +1212,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>66</FileNumber>
<FileNumber>70</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1122,7 +1224,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>67</FileNumber>
<FileNumber>71</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1142,7 +1244,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>68</FileNumber>
<FileNumber>72</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1154,7 +1256,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>69</FileNumber>
<FileNumber>73</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1166,7 +1268,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>70</FileNumber>
<FileNumber>74</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1178,7 +1280,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>71</FileNumber>
<FileNumber>75</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1190,7 +1292,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>72</FileNumber>
<FileNumber>76</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1202,7 +1304,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>73</FileNumber>
<FileNumber>77</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1214,7 +1316,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>74</FileNumber>
<FileNumber>78</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1226,7 +1328,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>75</FileNumber>
<FileNumber>79</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1238,7 +1340,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>76</FileNumber>
<FileNumber>80</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1250,7 +1352,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>77</FileNumber>
<FileNumber>81</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1262,7 +1364,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>78</FileNumber>
<FileNumber>82</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1274,7 +1376,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>79</FileNumber>
<FileNumber>83</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1294,7 +1396,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>80</FileNumber>
<FileNumber>84</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1306,7 +1408,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>81</FileNumber>
<FileNumber>85</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1318,7 +1420,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>82</FileNumber>
<FileNumber>86</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1330,7 +1432,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>83</FileNumber>
<FileNumber>87</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1350,7 +1452,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>11</GroupNumber>
<FileNumber>84</FileNumber>
<FileNumber>88</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1362,7 +1464,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
<FileNumber>85</FileNumber>
<FileNumber>89</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1374,7 +1476,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
<FileNumber>86</FileNumber>
<FileNumber>90</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1386,7 +1488,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
<FileNumber>87</FileNumber>
<FileNumber>91</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1396,18 +1498,6 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>11</GroupNumber>
<FileNumber>88</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\task\dbus.c</PathWithFileName>
<FilenameWithoutPath>dbus.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>

View File

@ -313,7 +313,7 @@
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>3</Optim>
<Optim>4</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
@ -1324,6 +1324,16 @@
<FileType>5</FileType>
<FilePath>..\User\bsp\flash.h</FilePath>
</File>
<File>
<FileName>pwm.c</FileName>
<FileType>1</FileType>
<FilePath>..\User\bsp\pwm.c</FilePath>
</File>
<File>
<FileName>pwm.h</FileName>
<FileType>5</FileType>
<FilePath>..\User\bsp\pwm.h</FilePath>
</File>
</Files>
</Group>
<Group>
@ -1349,6 +1359,16 @@
<FileType>5</FileType>
<FilePath>..\User\device\lcd_driver\lcd_lib.h</FilePath>
</File>
<File>
<FileName>ws2812.c</FileName>
<FileType>1</FileType>
<FilePath>..\User\device\ws2812.c</FilePath>
</File>
<File>
<FileName>ws2812.h</FileName>
<FileType>5</FileType>
<FilePath>..\User\device\ws2812.h</FilePath>
</File>
</Files>
</Group>
<Group>
@ -1549,11 +1569,6 @@
<FileType>1</FileType>
<FilePath>..\User\task\radio.c</FilePath>
</File>
<File>
<FileName>dbus.c</FileName>
<FileType>1</FileType>
<FilePath>..\User\task\dbus.c</FilePath>
</File>
</Files>
</Group>
<Group>

Binary file not shown.

View File

@ -22,43 +22,25 @@ Dialog DLL: TCM.DLL V1.48.0.0
<h2>Project:</h2>
D:\CUBEMX\MR16\MDK-ARM\MR16.uvprojx
Project File Date: 12/07/2025
Project File Date: 12/10/2025
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\cangming\ARM\ARMCC\Bin'
Build target 'MR16'
Note: source file '..\User\bsp\gpio.c' - object file renamed from 'MR16\gpio.o' to 'MR16\gpio_1.o'.
Note: source file '..\User\bsp\spi.c' - object file renamed from 'MR16\spi.o' to 'MR16\spi_1.o'.
compiling mr16.c...
../User/module/mr16.h(105): warning: #1-D: last line of file ends without a newline
#endif
../User/bsp/time.h(24): warning: #1295-D: Deprecated declaration BSP_TIME_Get_ms - give arg types
uint32_t BSP_TIME_Get_ms();
../User/bsp/time.h(26): warning: #1295-D: Deprecated declaration BSP_TIME_Get_us - give arg types
uint64_t BSP_TIME_Get_us();
../User/bsp/time.h(28): warning: #1295-D: Deprecated declaration BSP_TIME_Get - give arg types
uint64_t BSP_TIME_Get();
compiling gpio.c...
../User/bsp/gpio.h(59): warning: #1-D: last line of file ends without a newline
#endif
../User/component/user_math.h(179): warning: #1-D: last line of file ends without a newline
/* USER FUNCTION END */
..\User\module\mr16.c(209): warning: #546-D: transfer of control bypasses initialization of:
variable "RXheader" (declared at line 223)
switch (source) {
^
..\User\module\mr16.c(507): warning: #188-D: enumerated type mixed with another type
LCD_Init(1);
..\User\module\mr16.c(1259): warning: #186-D: pointless comparison of unsigned integer with zero
if (val < 0 || val > 255) { snprintf(pcWriteBuffer, xWriteBufferLen, "Invalid LoRa Preamble (0-255)\r\n"); return pdFALSE; }
..\User\module\mr16.c(94): warning: #177-D: variable "MR16_FSM" was declared but never referenced
static MR16_FSM_t MR16_FSM = MR16_FSM_NONE;
..\User\module\mr16.c(748): warning: #177-D: variable "baudrate_help" was declared but never referenced
static const char baudrate_help[] =
..\User\module\mr16.c: 11 warnings, 0 errors
..\User\bsp\gpio.c(119): warning: #188-D: enumerated type mixed with another type
HAL_GPIO_WritePin(GPIO_Map[gpio].gpio, GPIO_Map[gpio].pin, value);
..\User\bsp\gpio.c(132): warning: #1-D: last line of file ends without a newline
}
..\User\bsp\gpio.c: 3 warnings, 0 errors
linking...
Program Size: Code=47432 RO-data=10572 RW-data=272 ZI-data=20016
Program Size: Code=49764 RO-data=14636 RW-data=304 ZI-data=13544
FromELF: creating hex file...
"MR16\MR16.axf" - 0 Error(s), 11 Warning(s).
"MR16\MR16.axf" - 0 Error(s), 3 Warning(s).
<h2>Software Packages used:</h2>
@ -82,7 +64,7 @@ Package Vendor: Keil
* Component: ARM::CMSIS:CORE:5.4.0
Include file: CMSIS\Core\Include\tz_context.h
Build Time Elapsed: 00:00:03
Build Time Elapsed: 00:00:02
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,9 @@
"mr16\uart.o"
"mr16\time.o"
"mr16\flash.o"
"mr16\pwm.o"
"mr16\lcd.o"
"mr16\ws2812.o"
"mr16\sx1281.o"
"mr16\sx1281_driver.o"
"mr16\sx1281_driver_gpio.o"
@ -59,7 +61,6 @@
"mr16\init.o"
"mr16\user_task.o"
"mr16\radio.o"
"mr16\dbus.o"
--library_type=microlib --strict --scatter "MR16\MR16.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -49,6 +49,7 @@ mr16\mr16.o: ../User/device/lcd_driver/lcd.h
mr16\mr16.o: ../User/bsp/spi.h
mr16\mr16.o: ../Core/Inc/spi.h
mr16\mr16.o: ../User/bsp/gpio.h
mr16\mr16.o: ../User/device/ws2812.h
mr16\mr16.o: ../User/component/crc16.h
mr16\mr16.o: ../User/component/user_math.h
mr16\mr16.o: D:\cangming\ARM\ARMCC\Bin\..\include\float.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
MDK-ARM/MR16/pwm.crf Normal file

Binary file not shown.

34
MDK-ARM/MR16/pwm.d Normal file
View File

@ -0,0 +1,34 @@
mr16\pwm.o: ..\User\bsp\pwm.c
mr16\pwm.o: ../Core/Inc/tim.h
mr16\pwm.o: ../Core/Inc/main.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
mr16\pwm.o: ../Core/Inc/stm32f1xx_hal_conf.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h
mr16\pwm.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
mr16\pwm.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h
mr16\pwm.o: ../Drivers/CMSIS/Include/core_cm3.h
mr16\pwm.o: D:\cangming\ARM\ARMCC\Bin\..\include\stdint.h
mr16\pwm.o: ../Drivers/CMSIS/Include/cmsis_version.h
mr16\pwm.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
mr16\pwm.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
mr16\pwm.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
mr16\pwm.o: D:\cangming\ARM\ARMCC\Bin\..\include\stddef.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h
mr16\pwm.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
mr16\pwm.o: ../User/bsp/pwm.h
mr16\pwm.o: ../User/bsp/bsp.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -53,3 +53,4 @@ mr16\radio.o: ../User/bsp/bsp.h
mr16\radio.o: ../User/bsp/uart.h
mr16\radio.o: ../User/device/sx1281_driver/radio.h
mr16\radio.o: ../User/module/config.h
mr16\radio.o: ../User/device/ws2812.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More