1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
31
32
33
34
35
36
37
38
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
65
66
67
68
69
70
71
72
76
77
78
99
100
101
104
105
/* ... */
#include "main.h"
#include "lcd_log.h"
/* ... */
/* ... */
Includes
/* ... */
void Log_demo(void)
{
JOYState_TypeDef JoyState = JOY_NONE;
uint8_t i = 0;
while (CheckForUserInput() == 0);
BSP_JOY_Init(JOY_MODE_GPIO);
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)"Log Example");
LCD_LOG_SetFooter((uint8_t *)"Use Joystick to scroll up/down");
for (i = 0; i < 10; i++)
{
LCD_UsrLog ("This is Line %d \n", i);
}for (i = 0; i < 10; i++) { ... }
HAL_Delay(2000);
LCD_LOG_ClearTextZone();
for (i = 0; i < 30; i++)
{
LCD_UsrLog ("This is Line %d \n", i);
}for (i = 0; i < 30; i++) { ... }
while (1)
{
JoyState = BSP_JOY_GetState();
switch (JoyState)
{
case JOY_UP:
LCD_LOG_ScrollBack();
break;case JOY_UP:
case JOY_DOWN:
LCD_LOG_ScrollForward();
break;
case JOY_DOWN:
default:
break;default
}switch (JoyState) { ... }
if (CheckForUserInput() > 0)
{
return;
}if (CheckForUserInput() > 0) { ... }
HAL_Delay (10);
}while (1) { ... }
}{ ... }
/* ... */
/* ... */