Skip to content

Enhance DEBUG_UART feature (used by printf) #162

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 3 commits into from
Nov 30, 2017

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Nov 29, 2017

If the debug UART is not initialized by a Serial instance, init it at 9600 (8N1) by default.
Else use the config done by the Serial instance.

Those values could be redefined in the variant.h
DEBUG_UART could be redefined to print on another instance than 'Serial'
#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3
DEBUG_UART baudrate, default: 9600 if not defined
#define DEBUG_UART_BAUDRATE 115200
DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
#define DEBUG_PINNAME_TX PX_n // PinName used for TX

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm added the enhancement New feature or request label Nov 29, 2017
@fpistm fpistm added this to the Next release milestone Nov 29, 2017
@fpistm fpistm self-assigned this Nov 29, 2017
@fpistm fpistm requested a review from a user November 29, 2017 16:21
Signed-off-by: Frederic.Pillon <[email protected]>
If the debug UART is not initialized by a Serial instance, init it at 9600 (8N1) by default.
Else use the config done by the Serial instance.

Those values could be redefined in the variant.h
DEBUG_UART could be redefined to print on another instance than 'Serial'
#define DEBUG_UART              ((USART_TypeDef *) U(S)ARTX) // ex: USART3
DEBUG_UART baudrate, default: 9600 if not defined
#define DEBUG_UART_BAUDRATE     115200
DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
#define DEBUG_PINNAME_TX        PX_n // PinName used for TX

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm merged commit 098de37 into stm32duino:master Nov 30, 2017
@fpistm fpistm deleted the uart_debug branch November 30, 2017 09:36
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Enhance DEBUG_UART feature (used by printf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant