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

TF-Lite Micro: Fix C linkage for stm32f4HAL target #40467

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion tensorflow/lite/micro/stm32f4HAL/debug_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ limitations under the License.

extern UART_HandleTypeDef DEBUG_UART_HANDLE;

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __GNUC__
int __io_putchar(int ch) {
HAL_UART_Transmit(&DEBUG_UART_HANDLE, (uint8_t *)&ch, 1, HAL_MAX_DELAY);
Expand All @@ -36,4 +40,8 @@ int fputc(int ch, FILE *f) {
}
#endif /* __GNUC__ */

extern "C" void DebugLog(const char *s) { fprintf(stderr, "%s", s); }
void DebugLog(const char *s) { fprintf(stderr, "%s", s); }

#ifdef __cplusplus
}
#endif