... | @@ -12,7 +12,7 @@ const bool defaultSerialFlowctrl=false; //use rts/cts |
... | @@ -12,7 +12,7 @@ const bool defaultSerialFlowctrl=false; //use rts/cts |
|
#define SERIAL_1_DMA //use the DMA
|
|
#define SERIAL_1_DMA //use the DMA
|
|
```
|
|
```
|
|
|
|
|
|
> :warning: **WARNING: printfs are very heavy and can significantly modify the timings if used inside drivers. For this reason, we suggest instead the use of TRACE() throughout the code.**
|
|
> :warning: **WARNING: printf() is very heavy and can significantly modify the timings if used inside drivers. For this reason, we suggest instead the use of TRACE() throughout the code. TRACE() works as a normal printf() if DEBUG is defined (see below example), otherwise it does not perform any operation.**
|
|
|
|
|
|
## Using `fnctl.h` (other serial ports)
|
|
## Using `fnctl.h` (other serial ports)
|
|
|
|
|
... | @@ -85,7 +85,7 @@ const bool auxSerialFlowctrl=false; |
... | @@ -85,7 +85,7 @@ const bool auxSerialFlowctrl=false; |
|
### Example
|
|
### Example
|
|
Usage of *TRACE()* in order to send data to the PC.
|
|
Usage of *TRACE()* in order to send data to the PC.
|
|
|
|
|
|
##### test-serial.cpp
|
|
#### test-serial.cpp
|
|
```cpp
|
|
```cpp
|
|
#include <Common.h>
|
|
#include <Common.h>
|
|
|
|
|
... | @@ -104,7 +104,7 @@ int main() |
... | @@ -104,7 +104,7 @@ int main() |
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
```
|
|
```
|
|
##### sbs.conf
|
|
#### sbs.conf
|
|
You should also add the following configuration to `sbs.conf`.
|
|
You should also add the following configuration to `sbs.conf`.
|
|
```config
|
|
```config
|
|
[test-serial]
|
|
[test-serial]
|
... | @@ -115,5 +115,5 @@ Include: %shared |
... | @@ -115,5 +115,5 @@ Include: %shared |
|
Defines: -DDEBUG
|
|
Defines: -DDEBUG
|
|
Main: test-serial
|
|
Main: test-serial
|
|
```
|
|
```
|
|
The *-DDEBUG* define is necessary in order for the *TRACE()* macro to act as a normal *printf()*.
|
|
The *-DDEBUG* define is necessary in order for the *TRACE()* function to act as a normal *printf()*.
|
|
Moreover the *shared* include is needed in order to compile also `Debug.cpp`, on which the *TRACE()* macro depends. |
|
Moreover the *shared* include is needed in order to compile also `Debug.cpp`, on which the *TRACE()* macro depends. |
|
|
|
\ No newline at end of file |