Skip to content
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

Documentação do código #6

Merged
merged 71 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c07b219
:busts_in_silhouette: Add Code of Conduct
LucasHaug Oct 7, 2020
0d07d50
:page_facing_up: Add License
LucasHaug Oct 7, 2020
11e7863
:pencil: Add doxyfile and :art: css for generated doc
LucasHaug Oct 10, 2020
f0a1349
:see_no_evil: Add .gitignore
LucasHaug Oct 10, 2020
9b13a70
:memo: Update README
LucasHaug Oct 10, 2020
bc79a2b
:art: Update badges
LucasHaug Oct 10, 2020
abff2c0
:busts_in_silhouette: Add contributors
LucasHaug Oct 10, 2020
9691113
:busts_in_silhouette: Add @Berbardo as a contributor
LucasHaug Oct 10, 2020
4ca7043
:see_no_evil: Update .gitignore
LucasHaug Oct 18, 2020
f469e49
:truck: Create assets folder and move files
LucasHaug Oct 18, 2020
e24b68c
:pencil: Update hw config in README
LucasHaug Oct 18, 2020
96f43eb
:camera: Add hw config images
LucasHaug Oct 18, 2020
2101d36
:pencil: Add cube configuration to the README
LucasHaug Oct 19, 2020
e6c3cdf
:pencil: Update how to use the library
LucasHaug Oct 20, 2020
277167f
:art: Fix emoji
LucasHaug Oct 20, 2020
ccdcac7
:pencil: Add `rf24_delay` to the README
LucasHaug Oct 20, 2020
2bde415
:pencil: Fix spelling
LucasHaug Oct 20, 2020
a5507d0
:bug: Fix forgotten CSN
LucasHaug Oct 21, 2020
a415005
:pencil: Add initializing subsection
LucasHaug Oct 21, 2020
c07dac2
:pencil: Add detail about the tutorial
LucasHaug Oct 21, 2020
82e90c4
:pencil: Fix spelling
LucasHaug Oct 21, 2020
eb8d2c3
:pencil: Add transmissor tutorial
LucasHaug Oct 22, 2020
30fa304
:pencil: Add receiver text
LucasHaug Oct 22, 2020
aa6a743
:pencil: Fix spelling
LucasHaug Oct 22, 2020
be0a8d3
:bug: Add debug infos
LucasHaug Oct 30, 2020
69bf3aa
:art: Change emoji
LucasHaug Oct 30, 2020
732b23c
:art: Add formatting section
LucasHaug Oct 30, 2020
be38347
:sparkles: Add uncrustify
LucasHaug Oct 30, 2020
79fd1d6
:pencil: Update formatting section
LucasHaug Oct 30, 2020
d1b3c5a
:busts_in_silhouette: Add Contributing
LucasHaug Oct 30, 2020
f25b046
:truck: Rename Contributing in pt
LucasHaug Oct 30, 2020
a717b0d
:globe_with_meridians: Translate contributing
LucasHaug Oct 31, 2020
cba34de
:pencil: Fix links and gramatic
LucasHaug Oct 31, 2020
bec7d0f
:truck: Add README pt-br
LucasHaug Oct 31, 2020
7ba9387
:pencil2: Add README
LucasHaug Oct 31, 2020
0f5f651
:pencil: Add default all-contributors message
LucasHaug Oct 31, 2020
00ea236
:pencil: Update README index
LucasHaug Oct 31, 2020
047e6ba
:globe_with_meridians: Translate README
LucasHaug Oct 31, 2020
c319bd8
:pencil: Fix links and gramatics
LucasHaug Oct 31, 2020
6265f49
:pencil: Update code documentation
LucasHaug Oct 31, 2020
700afdb
:recycle: Refactor code
LucasHaug Oct 31, 2020
644b497
:pencil: Update documentation
LucasHaug Oct 31, 2020
27070ce
:memo: Update READMEs
LucasHaug Oct 31, 2020
f28f0b0
:wrench: Add uncrustify.cfg
LucasHaug Oct 31, 2020
bf031e9
:art: Format files
LucasHaug Oct 31, 2020
f306729
:art: Format rf24_debug manually
LucasHaug Oct 31, 2020
d2cf06e
:see_no_evil: Add newline to .gitignore
LucasHaug Oct 31, 2020
ab62cef
:memo: Update comments
LucasHaug Oct 31, 2020
a90d6e4
:pencil: Fix spelling
LucasHaug Oct 31, 2020
463b5cb
:pencil: Fix README section title
LucasHaug Oct 31, 2020
92ae46c
:recycle: Change bit shift macro
LucasHaug Oct 31, 2020
84105fb
:recycle: Remove magic numbers
LucasHaug Oct 31, 2020
df278dc
Update CONTRIBUTING.md
LucasHaug Oct 31, 2020
bda5a82
Update CONTRIBUTING.md
LucasHaug Oct 31, 2020
49760dd
Update CONTRIBUTING.md
LucasHaug Oct 31, 2020
79f13ca
Update CONTRIBUTING.md
LucasHaug Oct 31, 2020
834bf30
Update README.md
LucasHaug Oct 31, 2020
541fcba
:ok_hand: Update README and Contributing
LucasHaug Oct 31, 2020
e69a643
:busts_in_silhouette: Update @d-nery as a contributor
LucasHaug Oct 31, 2020
a765ce3
:busts_in_silhouette: Update @lucastrschneider as a contributor
LucasHaug Oct 31, 2020
9dea2b3
:ok_hand: Fix spelling and code consistency
LucasHaug Oct 31, 2020
6644fd4
:pencil: Correct grammar
LucasHaug Oct 31, 2020
f7bfbe4
Update CONTRIBUTING.md
LucasHaug Nov 5, 2020
1bc6473
:pencil: Fix spelling in README
LucasHaug Nov 25, 2020
aacafed
:pencil: Fix spelling in CONTRIBUTING
LucasHaug Nov 25, 2020
4b24438
:pencil: :brazil: Correct spelling in README and CONTRIBUTING
LucasHaug Nov 25, 2020
9505d5c
:pencil: Correct spelling
LucasHaug Nov 25, 2020
49fa4d6
:busts_in_silhouette: Update @FelipeGdM as a contributor
LucasHaug Nov 25, 2020
f16d498
:pencil: Add assets folder to README
LucasHaug Nov 26, 2020
a277f01
:pencil: Correct spelling
LucasHaug Nov 26, 2020
5a42775
:pencil: Correct grammar
LucasHaug Nov 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ There are some guidelines for organizing C code that should be followed.

― Harold Abelson, Structure and Interpretation of Computer Programs

#### Scopes
#### Variables and functions scopes

Always reduce the scopes of the to the minimum possible, avoiding global, external and static variables, giving preference to local variables. The same is ture for functions, do not create public functions if they are only to be used within a file, leave them private.
LucasHaug marked this conversation as resolved.
Show resolved Hide resolved
LucasHaug marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -96,8 +96,6 @@ For more naming tips, see the article ["How To Create Meaningful Names In Code"]

Make coherent choices for your variable types and your functions return and parameters types. For examples, do not use `float` if your variable is a unit counter.

Além disso, para variáveis inteiras faça distinção entre `signed` e `unsigned` e especifique seu tamanho em bits, isso garante mais controle sobre os valores que cada variável pode ter, como também otimiza a ocupação da memória. Para isso utilize a biblioteca `stdint.h`, podendo assim, por exemplo, se utilizar os tipos `uint8_t` para inteiros de 8 bits sem sinal e `int16_t` para inteiros de 16 bits com sinal.

Besides that, for integer variables, distinguish between `signed` and `unsigned` and specify their size in bits, this ensures more control over the values that each variable can have, as well as optimizes the memory occupation. To do this, use the `stdint.h` library, than, for example, you can use the types `uint8_t` for unsigned 8-bit integers and `int16_t` for signed 16-bit integers.

#### Magic numbers/Constants
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Existem algumas diretrizes de organização de código em C que devem seguidas.

― Harold Abelson, Structure and Interpretation of Computer Programs

#### Escopos
#### Escopos de variáveis e funções

Reduza sempre os escopos das variáveis ao menor possível, evitando variáveis globais, externas e estáticas, dando preferência para variáveis locais. O mesmo é válido para funções, não crie funções públicas se elas so forem ser usadas dentro de um arquivo, deixe elas privadas.

Expand Down Expand Up @@ -98,7 +98,7 @@ Além disso, para variáveis inteiras faça distinção entre `signed` e `unsign

#### Números mágicos/Constantes

Evite [números mágicos](https://pt.wikipedia.org/wiki/N%C3%BAmero_m%C3%A1gico_(programa%C3%A7%C3%A3o_de_sistemas)) no meio do código, além de eles obscurecerem o entendimento do mesmo, também dificultam a manutenção. Para contornar isso, utilize constantes definidas com `#define` no ínicio do seu código.
Evite [números mágicos](https://pt.wikipedia.org/wiki/N%C3%BAmero_m%C3%A1gico_(programa%C3%A7%C3%A3o_de_sistemas)) no meio do código. Além de eles dificultarem a leitura do mesmo, também dificultam a manutenção. Para contornar isso, utilize constantes definidas com `#define` no ínicio do seu código.
LucasHaug marked this conversation as resolved.
Show resolved Hide resolved

### Menssagens de commit

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ To configure your hardware, you must first analyze the pinout of the nRF24L01 mo

![nRF24L01 Module's Pinout](./assets/img/nrf24l01_pinout.png)

The module uses SPI (Serial Protocol Interface) to communicate with the microcontroller (to learn more about SPI, I recommend this article [here](https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all) from Sparkfun), so four pins are required for this communication, SCK, MISO, MOSI and CSN. The CSN is a GPIO pin, while the others are dedicated pins.
The module uses SPI (Serial Protocol Interface) to communicate with the microcontroller (to learn more about SPI, we recommend this article [here](https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all) from Sparkfun), so four pins are required for this communication, SCK, MISO, MOSI and CSN. The CSN is a GPIO pin, while the others are dedicated pins.

In addition, a GPIO pin connected to the CE (Chip Enable) is needed, which is used to control the module, enabling the transition between the states of the module's finite state machine.

Expand Down Expand Up @@ -391,7 +391,7 @@ if ((device_status = rf24_available(p_dev, NULL)) == RF24_SUCCESS) {

### 🐛 Debugging

To debug your code it is possible to use the functions of the file `rf24_debug.c/.h`, but for this it is also necessary to define a `printf` function. For ease of use, I recommend adding the [SEGGER_RTT](https://github.com/ThundeRatz/SEGGER_RTT) to the project. After adding it, having called the debugging functions in your code, to see what is being "printed" by the functions, run in the terminal, being at the root of your project:
To debug your code it is possible to use the functions of the file `rf24_debug.c/.h`, but for this it is also necessary to define a `printf` function. For ease of use, we recommend adding the [SEGGER_RTT](https://github.com/ThundeRatz/SEGGER_RTT) to the project. After adding it, having called the debugging functions in your code, to see what is being "printed" by the functions, run in the terminal, being at the root of your project:

```C
make rtt
Expand Down