-
-
Notifications
You must be signed in to change notification settings - Fork 78
Moved and renamed files for consistent C code style #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <Tactility/Driver.h> | ||
| #include <tactility/driver.h> | ||
|
|
||
| extern "C" { | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <Tactility/Driver.h> | ||
| #include <tactility/driver.h> | ||
|
|
||
| extern "C" { | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #include "TloraPager.h" | ||
|
|
||
| #include <Tactility/Driver.h> | ||
| #include <tactility/driver.h> | ||
|
|
||
| #include <esp_log.h> | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /dts-v1/; | ||
|
|
||
| #include <Tactility/bindings/root.h> | ||
| #include <tactility/bindings/root.h> | ||
|
|
||
| / { | ||
| compatible = "root"; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /dts-v1/; | ||
|
|
||
| #include <Tactility/bindings/root.h> | ||
| #include <tactility/bindings/root.h> | ||
|
|
||
| / { | ||
| model = "Simulator"; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...2/Include/Tactility/bindings/esp32_gpio.h → ...2/Include/tactility/bindings/esp32_gpio.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...32/Include/Tactility/bindings/esp32_i2c.h → ...32/Include/tactility/bindings/esp32_i2c.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...sp32/Include/Tactility/drivers/Esp32I2c.h → ...p32/Include/tactility/drivers/esp32_i2c.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...latformEsp32/Source/drivers/Esp32Gpio.cpp → ...atformEsp32/Source/drivers/esp32_gpio.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.