Skip to content

Commit 937ea66

Browse files
Merge branch 'release/0.4.0'
2 parents 3a477eb + 9a1f917 commit 937ea66

29 files changed

Lines changed: 1159 additions & 842 deletions

.vscode/tasks.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,28 @@
1717
"color": "terminal.ansiGreen"
1818
},
1919

20+
"args": [],
21+
"group": "build",
22+
"presentation": {
23+
"reveal": "always",
24+
"clear": true
25+
},
26+
"problemMatcher": "$gcc"
27+
},
28+
{
29+
"label": "rebuild fast",
30+
"type": "shell",
31+
"windows": {
32+
"command": [
33+
".//makeProject.bat"
34+
]
35+
},
36+
37+
"icon": {
38+
"id": "debug-alt",
39+
"color": "terminal.ansiGreen"
40+
},
41+
2042
"args": [],
2143
"group": "build",
2244
"presentation": {
@@ -108,6 +130,28 @@
108130
"color": "terminal.ansiGreen"
109131
},
110132

133+
"args": [],
134+
"group": "build",
135+
"presentation": {
136+
"reveal": "always",
137+
"clear": true
138+
},
139+
"problemMatcher": "$gcc"
140+
},
141+
{
142+
"label": "program j-link",
143+
"type": "shell",
144+
"windows": {
145+
"command": [
146+
".//programFlash_Jlink.cmd",
147+
]
148+
},
149+
150+
"icon": {
151+
"id": "arrow-down",
152+
"color": "terminal.ansiGreen"
153+
},
154+
111155
"args": [],
112156
"group": "build",
113157
"presentation": {

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
History of changes
2+
====
3+
4+
# 0.4.0
5+
- Add j-link programm script
6+
- Refactoring CC1101 driver
7+
- New sound control algorithm
8+
- Update CLI-Driver
9+
10+
# 0.3.2
11+
- Updating the FIFO queue library
12+
- Refactoring the CLI module
13+
- Updating the project structure: separation of user files and peripheral files generated by CubeMX
14+
- Adding C++ files to the project Build
15+
16+
# 0.3.1
17+
- Changed the software version project
18+
19+
# 0.3.0
20+
- Refactoring the project, without changing the functionality
21+
- Add Vscode tasks
22+
- Revision of the software release archive generation script
23+
24+
# 0.2.0
25+
26+
# 0.1.0

CHANGELOG.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

Core/Inc/main.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ extern "C" {
6767
void Error_Handler(void);
6868

6969
/* USER CODE BEGIN EFP */
70-
bool CC1101_reinit(void);
7170

7271
void checkResetSourse(void);
7372
/* USER CODE END EFP */
@@ -107,8 +106,8 @@ void checkResetSourse(void);
107106
/* USER CODE BEGIN Private defines */
108107

109108
#define SOFTWARE_VERSION_MAJOR 0
110-
#define SOFTWARE_VERSION_MINOR 3
111-
#define SOFTWARE_VERSION_PATCH 2
109+
#define SOFTWARE_VERSION_MINOR 4
110+
#define SOFTWARE_VERSION_PATCH 0
112111

113112

114113
#define quoting(a) prequoting(a)

Core/Src/main.c

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ void checkResetSourse(void)
120120
__HAL_RCC_CLEAR_RESET_FLAGS();
121121
}
122122

123-
bool CC1101_reinit(void)
124-
{
125-
return TI_init(&hspi2, NSS_CS_GPIO_Port, NSS_CS_Pin); // CS
126-
}
127-
128123
static void stm32_cacheEnable(void)
129124
{
130125
#if (INSTRUCTION_CACHE_ENABLE != 0U) /* Enable caching instructions */
@@ -181,24 +176,11 @@ int main(void)
181176
MX_TIM2_Init();
182177
/* USER CODE BEGIN 2 */
183178

184-
/* Setting up the display */
185-
LCD_SPI_Connected_data spi_con =
186-
{
187-
.spi = SPI1,
188-
.dma_tx = dma_tx_1, // data DMA
189-
.reset_port = LCD_RESET_GPIO_Port,
190-
.reset_pin = LCD_RESET_Pin,
191-
.dc_port = LCD_DC_GPIO_Port,
192-
.dc_pin = LCD_DC_Pin,
193-
.cs_port = LCD_CS_GPIO_Port,
194-
.cs_pin = LCD_CS_Pin
195-
};
196-
197179
#ifndef LCD_DYNAMIC_MEM
198180
LCD_Handler lcd1;
199181
#endif
200-
// Creating a display handler ILI9341
201-
LCD = LCD_DisplayAdd(LCD,
182+
183+
LCD = LCD_DisplayAdd(LCD,
202184
#ifndef LCD_DYNAMIC_MEM
203185
&lcd1,
204186
#endif
@@ -214,64 +196,65 @@ int main(void)
214196
ILI9341_SetWindow,
215197
ILI9341_SleepIn,
216198
ILI9341_SleepOut,
217-
&spi_con,
199+
displayInit_getSpiPortSettings(),
218200
LCD_DATA_16BIT_BUS,
219201
bkl_data);
220202

221203
lcd = LCD; //Pointer to the first display in the list
222204
LCD_Init(lcd);
223205
LCD_Fill(lcd, COLOR_RED);
224206

225-
226207
XPT2046_InitTouch(&touch1, 20, &cnt_touch); //initializing the handler XPT2046
227208

228209
#if !CALIBRATE_EN
229-
tCoef coef = {.D = 0x00022b4253626d37,
230-
.Dx1 = 0xffffd9e9e85d81b6,
231-
.Dx2 = 0x0000005a555c98ab,
232-
.Dx3 = 0x022dd7f0419e66b7,
233-
.Dy1 = 0xffffff6065e10c98,
234-
.Dy2 = 0x0000343b820dc8bf,
235-
.Dy3 = 0xff9cc25725238e55 };
236-
touch1.coef = coef;
210+
touch1.coef = *displayInit_getCalibrationCoefficient();
237211
#else
238-
calibrateTouchEnable();
212+
calibrateTouchEnable();
239213
#endif
240214

241-
#if RUN_DEMO
215+
#if RUN_LCD_DEMO
242216
LCD_Fill(lcd, COLOR_WHITE);
243217
Draw_TouchPenDemo(&touch1, lcd);
244218
RoadCircleDemo(&touch1, lcd);
245219
#endif
246-
247220
LCD_Fill(lcd, COLOR_BLACK);
248-
249-
// test C++
250-
debugPrintf("C++ test: %s"CLI_NEW_LINE, test_cpp_function() ? "true" : "false");
251-
252221
/* USER CODE END 2 */
253222

254223
/* Infinite loop */
255224
/* USER CODE BEGIN WHILE */
256225

226+
#if CLI_ENABLE
227+
cli_init();
228+
#endif // CLI_ENABLE
229+
230+
debugPrintf("C++ test: %s"CLI_NEW_LINE, test_cpp_function() ? "true" : "false");
231+
257232
buzzer_init(BUZZER_GPIO_Port, BUZZER_Pin);
258-
buzzer_enable();
259-
LL_mDelay(9);
260-
buzzer_disable();
233+
buzzer_soundOn(BUZZ_SOUND_TEST);
261234
debugPrintf("Buzzer test..."CLI_NEW_LINE);
262235

263236
adc_enable();
264237

265238
debugPrintf("CC1101 init..."CLI_NEW_LINE);
266-
267239
LCD_WriteString(lcd, 5, 25, "CC1101 int...",
268240
&Font_8x13, COLOR_WHITE, COLOR_BLACK, LCD_SYMBOL_PRINT_FAST);
269241

270-
CC1101_customSetCSpin(&hspi2, NSS_CS_GPIO_Port, NSS_CS_Pin);
242+
#if CC1101_CUSTOM_OLD_CONFIG
243+
CC1101_setCarrierFreq(CFREQ_433);
244+
CC1101_setDevAddress(1);
245+
#endif
246+
271247

272-
bool error_state = CC1101_power_up_reset();
248+
bool error_state = CC1101_init(&hspi2,
249+
NSS_CS_GPIO_Port, NSS_CS_Pin, // CS pin
250+
GPIOB, LL_GPIO_PIN_14, // MISO pin
251+
GPIOB, LL_GPIO_PIN_12); // GDO pin
273252

274-
if (error_state)
253+
if (!error_state)
254+
{
255+
debugPrintf(CLI_OK"CC1101 init pass"CLI_NEW_LINE);
256+
}
257+
else
275258
{
276259
LCD_WriteString(lcd, 5, 55, "CC1101 not found!",
277260
&Font_8x13, COLOR_WHITE, COLOR_RED, LCD_SYMBOL_PRINT_FAST);
@@ -281,20 +264,13 @@ calibrateTouchEnable();
281264
}
282265
}
283266

284-
#if CUSTOM_OLD_CONFIG
285-
TI_setCarrierFreq(CFREQ_433);
286-
TI_setDevAddress(1);
287-
#endif
288-
error_state = CC1101_reinit();
289-
if (!error_state) debugPrintf(CLI_OK"CC1101 init pass"CLI_NEW_LINE);
290-
291267
encoder_init();
292268

293269
/* USER CODE END WHILE */
294270

295271
/* USER CODE BEGIN 3 */
296272

297-
scheduler();
273+
scheduler_run();
298274

299275
/* USER CODE END 3 */
300276
}

Core/Src/stm32f4xx_it.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,7 @@ void EXTI15_10_IRQHandler(void)
289289
{
290290
LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_12);
291291
/* USER CODE BEGIN LL_EXTI_LINE_12 */
292-
if (HAL_GPIO_ReadPin(CC_GDO_GPIO_Port, CC_GDO_Pin) == GPIO_PIN_RESET)
293-
{
294-
CC1101_GDO0_flag_set();
295-
}
292+
CC1101_IRQHandler();
296293

297294
/* USER CODE END LL_EXTI_LINE_12 */
298295
}

0 commit comments

Comments
 (0)