... | ... | @@ -694,7 +694,7 @@ typedef struct { |
|
|
* Shall have the word `private` in it
|
|
|
* This improves code readability because in a large code module, it is easier to differentiate the function invocation internal or external to the code module
|
|
|
* Examples:
|
|
|
* `void UDS_client__private_func(void);`
|
|
|
* `void uds_client__private_func(void);`
|
|
|
* `app_battery__private_update_soc(void)`
|
|
|
* **Callback Functions**
|
|
|
* Callback functions should always contain an argument as this allows the caller to provide context to the function. This allows a single callback function to be used for multiple cases.
|
... | ... | @@ -844,9 +844,10 @@ Better alternatives to `#defines` are discussed below: |
|
|
* If a const variable is used, the variable can be altered.
|
|
|
* Use `const` in place of `#defines` because it binds a type to the variable.
|
|
|
* There may be a genuine reason where const would not work, so treat this as an exception. For example:
|
|
|
`static const int soc = 2;`
|
|
|
`#define MAX (2)`
|
|
|
`uint8_t array[count]; // ← Compiler error if global`
|
|
|
`static const size_t MODULE_NAME__ARRAY_COUNT_INVALID = 2;`
|
|
|
`#define MODULE_NAME__ARRAY_COUNT_VALID (2U)`
|
|
|
`uint8_t array[MODULE_NAME__ARRAY_COUNT_INVALID]; // ← Compiler error if global`
|
|
|
`uint8_t array[MODULE_NAME__ARRAY_COUNT_VALID];`
|
|
|
* Functions
|
|
|
* Only define function-like macros at `sl_function_macros.h`
|
|
|
* You will get scrutinized if you wish to add more macros to this file
|
... | ... | @@ -1244,7 +1245,7 @@ The templates follow the [Order of Includes](#order-of-includes) and we do not d |
|
|
## Header File
|
|
|
```c
|
|
|
/* SIBROS TECHNOLOGIES, INC. CONFIDENTIAL
|
|
|
* Copyright (c) 2018 - 2019 Sibros Technologies, Inc.
|
|
|
* Copyright (c) 2018 - 2020 Sibros Technologies, Inc.
|
|
|
* All Rights Reserved.
|
|
|
* NOTICE: All information contained herein is, and remains the property of Sibros Technologies,
|
|
|
* Inc. and its suppliers, if any. The intellectual and technical concepts contained herein are
|
... | ... | @@ -1305,7 +1306,7 @@ extern "C" { |
|
|
## Private Header File
|
|
|
```c
|
|
|
/* SIBROS TECHNOLOGIES, INC. CONFIDENTIAL
|
|
|
* Copyright (c) 2018 - 2019 Sibros Technologies, Inc.
|
|
|
* Copyright (c) 2018 - 2020 Sibros Technologies, Inc.
|
|
|
* All Rights Reserved.
|
|
|
* NOTICE: All information contained herein is, and remains the property of Sibros Technologies,
|
|
|
* Inc. and its suppliers, if any. The intellectual and technical concepts contained herein are
|
... | ... | @@ -1359,7 +1360,7 @@ extern "C" { |
|
|
## Source File
|
|
|
```c
|
|
|
/* SIBROS TECHNOLOGIES, INC. CONFIDENTIAL
|
|
|
* Copyright (c) 2018 - 2019 Sibros Technologies, Inc.
|
|
|
* Copyright (c) 2018 - 2020 Sibros Technologies, Inc.
|
|
|
* All Rights Reserved.
|
|
|
* NOTICE: All information contained herein is, and remains the property of Sibros Technologies,
|
|
|
* Inc. and its suppliers, if any. The intellectual and technical concepts contained herein are
|
... | ... | @@ -1402,7 +1403,7 @@ extern "C" { |
|
|
## Unity Unit-Test Source File
|
|
|
```c
|
|
|
/* SIBROS TECHNOLOGIES, INC. CONFIDENTIAL
|
|
|
* Copyright (c) 2018 - 2019 Sibros Technologies, Inc.
|
|
|
* Copyright (c) 2018 - 2020 Sibros Technologies, Inc.
|
|
|
* All Rights Reserved.
|
|
|
* NOTICE: All information contained herein is, and remains the property of Sibros Technologies,
|
|
|
* Inc. and its suppliers, if any. The intellectual and technical concepts contained herein are
|
... | ... | |