Thu, 07 Nov 2019 22:58:48 +0100
Finished the editor using the rotary switch. Added editing of the MQTT server parameters.
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /** |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * @file task_user.h |
22
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
3 | * @brief The FreeRTOS task to run the user interface. |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | */ |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | #ifndef _TASK_USER_H |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | #define _TASK_USER_H |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | #define PIN_SDA (CONFIG_I2C_MASTER_SDA) |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | #define PIN_SCL (CONFIG_I2C_MASTER_SCL) |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | #define ROT_ENC_A_GPIO (CONFIG_ROT_ENC_A_GPIO) |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | #define ROT_ENC_B_GPIO (CONFIG_ROT_ENC_B_GPIO) |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | #define ROT_ENC_SW_GPIO (CONFIG_ROT_ENC_SW_GPIO) |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | #define INACTIVITY 120 ///< User inactivity time |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | |
23
58a328e91881
Added error logging for failed locks
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
17 | #define EDIT_TYPE_TEXT 0 ///< Editor type is text, special chars and digits. |
58a328e91881
Added error logging for failed locks
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
18 | #define EDIT_TYPE_CAPS 1 ///< Editor alpha capitals, some specials and digits. |
58a328e91881
Added error logging for failed locks
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
19 | #define EDIT_TYPE_INT 2 ///< Editor type is integer |
58a328e91881
Added error logging for failed locks
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
20 | #define EDIT_TYPE_FLOAT 3 ///< Editor type is float |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
22
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
24 | /** |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
25 | * @brief Called after a power on or hard reset. |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
26 | */ |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | void user_cold(void); |
22
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
28 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
29 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
30 | /** |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
31 | * @brief Called after wakeup by the user. |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
32 | */ |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | void user_wakeup(void); |
22
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
34 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
35 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
36 | /** |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
37 | * @brief Refresh screens that are in focus. |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
38 | */ |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | void user_refresh(void); |
22
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
40 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
41 | |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
42 | /** |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
43 | * @brief Test is user interface is busy and active |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
44 | * @return Returns true if the user interface is active, false otherwise. |
cceb36fd3a2a
Better update of the user screens. Added more internal documentation.
Michiel Broek <mbroek@mbse.eu>
parents:
21
diff
changeset
|
45 | */ |
21
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | bool user_busy(void); |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | /** |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | * @brief The FreeRTOS task to run the user interface. |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | */ |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | void task_user(void *); |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | #endif |
043ae27633f8
Moved the user interface into a separate task. Added a real seconds timer to this task.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 |