mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-18 09:25:06 +00:00
Moved and renamed files for consistent C code style (#463)
* **Documentation** * Added new C coding style guide detailing naming conventions for files, directories, macros, constants, variables, functions, and type definitions with illustrative examples. * Updated C++ coding style documentation with clarifications on C naming conventions and header directory organization patterns. * **Refactor** * Updated header include paths throughout the codebase to use lowercase naming conventions consistently.
This commit is contained in:
parent
c05d46a28c
commit
d551e467b8
@ -144,9 +144,9 @@ def generate_devicetree_c(filename: str, items: list[object], bindings: list[Bin
|
||||
with open(filename, "w") as file:
|
||||
file.write(dedent('''\
|
||||
// Default headers
|
||||
#include <Tactility/Device.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/log.h>
|
||||
// DTS headers
|
||||
'''))
|
||||
|
||||
|
||||
96
CODING_STYLE_C.md
Normal file
96
CODING_STYLE_C.md
Normal file
@ -0,0 +1,96 @@
|
||||
# C coding Style
|
||||
|
||||
## Naming
|
||||
|
||||
### Files
|
||||
|
||||
Files are lower snake case.
|
||||
|
||||
- Files: `^[0-9a-z_]+$`
|
||||
- Directories: `^[0-9a-z_]+$`
|
||||
|
||||
Example:
|
||||
```c
|
||||
some_feature.c
|
||||
some_feature.h
|
||||
```
|
||||
|
||||
### Folders
|
||||
|
||||
Project folders include:
|
||||
- `source` for source files and public header files
|
||||
- `private` for private header files
|
||||
- `include` for projects that require separate header files
|
||||
|
||||
### Macros and consts
|
||||
|
||||
These are all upper snake case:
|
||||
|
||||
```c
|
||||
#define MY_CONST 1
|
||||
#define PRINT_SOMETHING() printf("something")
|
||||
const int ANOTHER_CONST = 1;
|
||||
```
|
||||
|
||||
### Variables
|
||||
|
||||
Variable names and function parameters are lower snake case:
|
||||
|
||||
```c
|
||||
int some_variable;
|
||||
```
|
||||
|
||||
### Enumerations and Structs
|
||||
|
||||
Enums and struct types are upper camel case.
|
||||
Its fields use lower snake case.
|
||||
|
||||
```c
|
||||
struct ThreadData {
|
||||
int some_attribute;
|
||||
};
|
||||
```
|
||||
|
||||
```c
|
||||
enum SomeResult {
|
||||
Ok,
|
||||
NotSupported,
|
||||
Error
|
||||
};
|
||||
```
|
||||
|
||||
### Function names
|
||||
|
||||
Function names are lower snake case.
|
||||
|
||||
Example:
|
||||
|
||||
```c
|
||||
void get_limit() {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
If a set of functions relates to a `struct`, the CamelCase struct name is converted to a snake_case_ prefix for the function name:
|
||||
|
||||
```c
|
||||
struct TextMessage {
|
||||
// ...
|
||||
};
|
||||
|
||||
void text_message_set(struct TextMessage* message) { /* ... */ }
|
||||
|
||||
void text_message_get(struct TextMessage* message) { /* ... */ }
|
||||
|
||||
```
|
||||
|
||||
### Typedef of simple value types
|
||||
|
||||
Typedefs for simple value types (such as int, int64_t, char) are lower snake case.
|
||||
They are postfixed with `_t`
|
||||
|
||||
Examples:
|
||||
|
||||
```c
|
||||
typedef uint32_t thread_id_t;
|
||||
```
|
||||
@ -6,6 +6,10 @@ All code should target C++ language revision 20.
|
||||
|
||||
If you use CLion, please enable the setting called "Enable ClangFormat" under Settings > Editor > Code Style.
|
||||
|
||||
# C projects with C++ code
|
||||
|
||||
In projects that expose a C API with internal C++ code, the C naming conventions are used for language features that are shared.
|
||||
|
||||
## Naming
|
||||
|
||||
### Files
|
||||
@ -21,8 +25,7 @@ SomeFeature.cpp
|
||||
SomeFeature.h
|
||||
```
|
||||
|
||||
Private/internal headers are postfixed with `Private` before the file extension.
|
||||
Like `SomeFeaturePrivate.h`
|
||||
Private/internal headers are placed in a `Private/` directory.
|
||||
|
||||
### Folders
|
||||
|
||||
@ -69,7 +72,7 @@ struct ThreadData {
|
||||
`enum class` or `enum struct` is preferred over plain `enum` because of scoping. It's styled like this:
|
||||
|
||||
```c++
|
||||
enum class {
|
||||
enum class SomeType {
|
||||
Ok,
|
||||
NotSupported,
|
||||
Error
|
||||
@ -1,4 +1,4 @@
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <Tactility/bindings/bindings.h>
|
||||
#include <Tactility/drivers/Root.h>
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
#include <drivers/TloraPager.h>
|
||||
|
||||
DEFINE_DEVICETREE(tlora_pager, struct RootConfig)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "TloraPager.h"
|
||||
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <Tactility/drivers/Root.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include <bindings/tlora_pager.h>
|
||||
#include <Tactility/bindings/esp32_gpio.h>
|
||||
#include <Tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
|
||||
/ {
|
||||
compatible = "lilygo,tlora-pager";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include <Tactility/bindings/root.h>
|
||||
#include <tactility/bindings/root.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#include "LvglTask.h"
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Thread.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/Thread.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "SdlTouch.h"
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
/** Hack: variable comes from LvglTask.cpp */
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/keyboard/KeyboardDevice.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/keyboard/KeyboardDevice.h>
|
||||
|
||||
class SdlKeyboard final : public tt::hal::keyboard::KeyboardDevice {
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/touch/TouchDevice.h"
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
class SdlTouch final : public tt::hal::touch::TouchDevice {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include <Tactility/bindings/root.h>
|
||||
#include <tactility/bindings/root.h>
|
||||
|
||||
/ {
|
||||
model = "Simulator";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "Drv2605.h"
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("DRV2605");
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#include "EspLcdDisplay.h"
|
||||
#include "EspLcdDisplayDriver.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
#include <cassert>
|
||||
#include <esp_lvgl_port_disp.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("EspLcdDisplay");
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Lock.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
#include <esp_lcd_types.h>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#include "EspLcdDisplayV2.h"
|
||||
#include "EspLcdDisplayDriver.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
#include <cassert>
|
||||
#include <esp_lvgl_port_disp.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("EspLcdDispV2");
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <esp_lcd_panel_dev.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Lock.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <esp_lcd_panel_dev.h>
|
||||
|
||||
#include <esp_lcd_types.h>
|
||||
#include <esp_lvgl_port_disp.h>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "RgbDisplay.h"
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include <Tactility/Tactility.h>
|
||||
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <devicetree.h>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/bindings/bindings.h>
|
||||
#include <Tactility/drivers/Esp32Gpio.h>
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_gpio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/bindings/bindings.h>
|
||||
#include <Tactility/drivers/Esp32I2c.h>
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_i2c.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/drivers/Gpio.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <hal/i2c_types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -2,6 +2,6 @@
|
||||
|
||||
#include <esp_err.h>
|
||||
|
||||
#include <Tactility/Error.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
error_t esp_err_to_error(esp_err_t error);
|
||||
@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/drivers/Esp32Gpio.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/esp32_gpio.h>
|
||||
|
||||
#include <Tactility/ErrorEsp32.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/drivers/Gpio.h>
|
||||
#include <Tactility/drivers/GpioController.h>
|
||||
#include <tactility/error_esp32.h>
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
|
||||
#define TAG LOG_TAG(esp32_gpio)
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <driver/i2c.h>
|
||||
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/drivers/Esp32I2c.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include "Tactility/ErrorEsp32.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/drivers/I2cController.h>
|
||||
#include <tactility/error_esp32.h>
|
||||
#include <tactility/drivers/esp32_i2c.h>
|
||||
|
||||
#define TAG LOG_TAG(esp32_i2c)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <Tactility/ErrorEsp32.h>
|
||||
#include <tactility/error_esp32.h>
|
||||
|
||||
error_t esp_err_to_error(esp_err_t error) {
|
||||
switch (error) {
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include <Tactility/app/ElfApp.h>
|
||||
|
||||
#include <Tactility/Bundle.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <Tactility/app/AppContext.h>
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/lvgl/Style.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
#include <Tactility/app/files/View.h>
|
||||
#include <Tactility/app/files/SupportedFiles.h>
|
||||
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/StringUtils.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/app/ElfApp.h>
|
||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
||||
#include <Tactility/app/imageviewer/ImageViewer.h>
|
||||
#include <Tactility/app/inputdialog/InputDialog.h>
|
||||
#include <Tactility/app/notes/Notes.h>
|
||||
#include <Tactility/app/ElfApp.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/kernel/Platform.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/StringUtils.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
#include <Tactility/app/fileselection/View.h>
|
||||
|
||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/kernel/Platform.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/StringUtils.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/kernel/Platform.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
|
||||
#include <Tactility/Assets.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
#include "Tactility/lvgl/LvglSync.h"
|
||||
|
||||
#include <Tactility/service/wifi/WifiApSettings.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/app/App.h>
|
||||
#include <Tactility/app/AppContext.h>
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/lvgl/Style.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
#include <Tactility/service/wifi/WifiApSettings.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/hal/Device.h>
|
||||
#include <Tactility/hal/gps/GpsInit.h>
|
||||
@ -7,7 +8,6 @@
|
||||
#include <Tactility/hal/power/PowerDevice.h>
|
||||
#include <Tactility/hal/spi/SpiInit.h>
|
||||
#include <Tactility/hal/uart/UartInit.h>
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/sdcard/SdCardMounting.h>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/gps/Cas.h>
|
||||
#include <Tactility/hal/gps/GpsDevice.h>
|
||||
#include <Tactility/hal/gps/Ublox.h>
|
||||
#include <Tactility/kernel/Kernel.h>
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include <Tactility/hal/i2c/I2c.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
namespace tt::hal::i2c {
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <Tactility/CoreDefines.h>
|
||||
#include <list>
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
#define LV_USE_PRIVATE_API 1 // For actual lv_obj_t declaration
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/PubSub.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/Timer.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/lvgl/Statusbar.h>
|
||||
#include <Tactility/lvgl/Style.h>
|
||||
#include <Tactility/PubSub.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/settings/Time.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/lvgl/Spinner.h>
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
|
||||
namespace tt::lvgl {
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include "Tactility/lvgl/Keyboard.h"
|
||||
#include "Tactility/Check.h"
|
||||
#include "Tactility/lvgl/LvglSync.h"
|
||||
#include "Tactility/service/gui/GuiService.h"
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/TactilityConfig.h>
|
||||
#include <Tactility/service/espnow/EspNowService.h>
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
#include <Tactility/lvgl/Statusbar.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/Timer.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/power/PowerDevice.h>
|
||||
#include <Tactility/hal/sdcard/SdCardDevice.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/lvgl/Lvgl.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/service/ServiceContext.h>
|
||||
#include <Tactility/service/ServicePaths.h>
|
||||
#include <Tactility/service/ServiceRegistration.h>
|
||||
#include <Tactility/service/gps/GpsService.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
namespace tt::service::statusbar {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/service/webserver/WebServerService.h>
|
||||
#include <Tactility/service/webserver/AssetVersion.h>
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/CoreDefines.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
#include <Tactility/service/ServiceRegistration.h>
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/EventGroup.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/LogMessages.h>
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <Tactility/PubSub.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/service/Service.h>
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "tt_hal_device.h"
|
||||
|
||||
#include "Tactility/Check.h"
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <Tactility/hal/Device.h>
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#include "tt_hal_display.h"
|
||||
|
||||
#include "Tactility/Check.h"
|
||||
#include "Tactility/hal/Device.h"
|
||||
#include "Tactility/hal/display/DisplayDevice.h"
|
||||
#include "Tactility/hal/display/DisplayDriver.h"
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <Tactility/hal/Device.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/display/DisplayDriver.h>
|
||||
|
||||
static ColorFormat toColorFormat(tt::hal::display::ColorFormat format) {
|
||||
switch (format) {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#include "Tactility/CpuAffinity.h"
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
namespace tt {
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include <Tactility/crypt/Crypt.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <mbedtls/aes.h>
|
||||
#include <cstring>
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/drivers/Gpio.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/bindings/bindings.h>
|
||||
#include <Tactility/drivers/Root.h>
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
|
||||
DEFINE_DEVICETREE(root, struct RootConfig)
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
__attribute__((noreturn)) extern void __crash(void);
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Error.h>
|
||||
#include <Tactility/FreeRTOS/FreeRTOS.h>
|
||||
#include <tactility/freertos/freertos.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -8,9 +8,9 @@ extern "C" {
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <Tactility/FreeRTOS/event_groups.h>
|
||||
#include <tactility/freertos/event_groups.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
static inline void event_group_construct(EventGroupHandle_t* eventGroup) {
|
||||
check(xPortInIsrContext() == pdFALSE);
|
||||
@ -5,8 +5,8 @@
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/FreeRTOS/semphr.h>
|
||||
#include <tactility/freertos/semphr.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tactility/freertos/semphr.h>
|
||||
#include <tactility/check.h>
|
||||
#include <stdbool.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/FreeRTOS/semphr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Time.h"
|
||||
#include "time.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
@ -9,8 +9,8 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include "Tactility/FreeRTOS/FreeRTOS.h"
|
||||
#include <tactility/freertos/freertos.h>
|
||||
#include <tactility/check.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Driver.h"
|
||||
#include "driver.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -12,8 +12,8 @@ extern "C" {
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "Error.h"
|
||||
#include <Tactility/concurrent/Mutex.h>
|
||||
#include "error.h"
|
||||
#include <tactility/concurrent/mutex.h>
|
||||
|
||||
struct Driver;
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include <stdbool.h>
|
||||
#include "Error.h"
|
||||
|
||||
struct Device;
|
||||
struct DeviceType;
|
||||
@ -6,9 +6,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <Tactility/Device.h>
|
||||
|
||||
#define GPIO_OPTIONS_MASK 0x1f
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "Gpio.h"
|
||||
#include <Tactility/Error.h>
|
||||
#include "gpio.h"
|
||||
#include <tactility/error.h>
|
||||
|
||||
struct GpioControllerApi {
|
||||
error_t (*set_level)(struct Device* device, gpio_pin_t pin, bool high);
|
||||
@ -8,10 +8,10 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "Gpio.h"
|
||||
#include "gpio.h"
|
||||
|
||||
#include <Tactility/FreeRTOS/FreeRTOS.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <tactility/freertos/freertos.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
struct I2cControllerApi {
|
||||
error_t (*read)(struct Device* device, uint8_t address, uint8_t* data, size_t dataSize, TickType_t timeout);
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <freertos/event_groups.h>
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifndef ESP_PLATFORM
|
||||
#define xPortInIsrContext() (pdFALSE)
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <freertos/queue.h>
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <freertos/semphr.h>
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <freertos/task.h>
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "freertos.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <freertos/timers.h>
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "Tactility/FreeRTOS/task.h"
|
||||
#include "tactility/freertos/task.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <esp_timer.h>
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include <Tactility/concurrent/Dispatcher.h>
|
||||
#include <tactility/concurrent/dispatcher.h>
|
||||
|
||||
#include "Tactility/Error.h"
|
||||
#include "tactility/error.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/concurrent/EventGroup.h>
|
||||
#include <Tactility/concurrent/Mutex.h>
|
||||
#include <tactility/concurrent/eventgroup.h>
|
||||
#include <tactility/concurrent/mutex.h>
|
||||
#include <tactility/log.h>
|
||||
#include <atomic>
|
||||
|
||||
#define TAG LOG_TAG("Dispatcher")
|
||||
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/concurrent/EventGroup.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <tactility/concurrent/eventgroup.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -1,5 +1,5 @@
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/FreeRTOS/task.h>
|
||||
#include <tactility/freertos/task.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
static const auto* TAG = LOG_TAG("Kernel");
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/Device.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <ranges>
|
||||
#include <cassert>
|
||||
@ -4,11 +4,11 @@
|
||||
#include <ranges>
|
||||
#include <vector>
|
||||
|
||||
#include <Tactility/concurrent/Mutex.h>
|
||||
#include <Tactility/Device.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/concurrent/mutex.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#define TAG LOG_TAG(driver)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/drivers/GpioController.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
|
||||
#define GPIO_DRIVER_API(driver) ((struct GpioControllerApi*)driver->api)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/drivers/I2cController.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <Tactility/Error.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#define I2C_DRIVER_API(driver) ((struct I2cControllerApi*)driver->api)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <Tactility/drivers/Root.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/root.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
@ -3,7 +3,7 @@
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
#include <Tactility/Device.h>
|
||||
#include <tactility/device.h>
|
||||
|
||||
TEST_CASE("device_construct and device_destruct should set and unset the correct fields") {
|
||||
Device device = { 0 };
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/FreeRTOS/task.h>
|
||||
#include <Tactility/concurrent/Dispatcher.h>
|
||||
#include <tactility/freertos/task.h>
|
||||
#include <tactility/concurrent/dispatcher.h>
|
||||
|
||||
TEST_CASE("dispatcher test") {
|
||||
DispatcherHandle_t dispatcher = dispatcher_alloc();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/Device.h>
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/device.h>
|
||||
|
||||
struct IntegrationDriverConfig {
|
||||
int startResult;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/Driver.h>
|
||||
#include <tactility/driver.h>
|
||||
|
||||
TEST_CASE("driver_construct and driver_destruct should set and unset the correct fields") {
|
||||
Driver driver = { 0 };
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#include "doctest.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <Tactility/FreeRTOS/task.h>
|
||||
#include <tactility/freertos/task.h>
|
||||
|
||||
typedef struct {
|
||||
int argc;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/concurrent/Mutex.h>
|
||||
#include <tactility/concurrent/mutex.h>
|
||||
|
||||
TEST_CASE("mutex_construct and mutex_destruct should properly set the handle") {
|
||||
Mutex mutex = { 0 };
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/concurrent/RecursiveMutex.h>
|
||||
#include <tactility/concurrent/recursive_mutex.h>
|
||||
|
||||
TEST_CASE("recursive_mutex_construct and mutex_destruct should properly set the handle") {
|
||||
RecursiveMutex mutex = { 0 };
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "doctest.h"
|
||||
#include <Tactility/Time.h>
|
||||
#include <Tactility/Delay.h>
|
||||
#include <tactility/delay.h>
|
||||
#include <tactility/time.h>
|
||||
|
||||
TEST_CASE("delay ticks should be accurate within 1 tick") {
|
||||
auto start_time = get_ticks();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user