suikan4github / murasaki

STM32 HAL class library
MIT License
18 stars 3 forks source link

Installer is searching for StartDefaultTask() imprecisely. #151

Closed suikan4github closed 1 year ago

suikan4github commented 1 year ago

Describe the bug The murasaki/installer is searching for the "StartDefaultTask" imprecisely. The installer is going to add following lines into this function :

  InitPlatform();
  ExecPlatform();

Previously, the installer was searching for the string "USER CODE BEGIN 5" in the main.c to insert.

From the CubeIDE version 1.12.0, the situation is very complicated. So, some times above algorithm struggles to installer.

To Reproduce There are 2 cases. The case 2 is the new pattern for H506.

Case Target location of the StartDefaultTask() Tag
1 STM32F446 main.c USER CODE BEGIN 5
2 STM32H506 app_freertos.c User CODE BEGIN defaultTask

Expected behavior The installer have to handle both CASE correctly. The following algorithm is preferable :

  1. Search for the StartDefaultTask() in the Src directory, and record it.
  2. Insert the code to call stub after the "USER CODE BEGIN 5" and "USER CODE BEGIN defaultTask".

We can assume the "USER CODE 5" and the "USER CODE BEGIN defaultTask" are exclusive.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

suikan4github commented 1 year ago

Merged to develop. Ready to release.