From aa9d6982046d92e97949cd0e8b38e4c52808b934 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 10 Mar 2016 16:58:51 -0800 Subject: [PATCH] mavlink_log: support telem printfs on QURT --- src/include/mavlink/mavlink_log.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/include/mavlink/mavlink_log.h b/src/include/mavlink/mavlink_log.h index f0141d8a17..77782dd056 100644 --- a/src/include/mavlink/mavlink_log.h +++ b/src/include/mavlink/mavlink_log.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2015 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2016 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -107,9 +107,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...); * @param _text The text to log; */ #define mavlink_and_console_log_emergency(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_EMERGENCY, _text, ##__VA_ARGS__); \ - fprintf(stderr, "telem> "); \ - fprintf(stderr, _text, ##__VA_ARGS__); \ - fprintf(stderr, "\n"); } while(0); + PX4_ERR("telem> "); \ + PX4_ERR(_text, ##__VA_ARGS__); \ + PX4_ERR("\n"); } while(0); /** * Send a mavlink critical message and print to console. @@ -118,9 +118,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...); * @param _text The text to log; */ #define mavlink_and_console_log_critical(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_CRITICAL, _text, ##__VA_ARGS__); \ - fprintf(stderr, "telem> "); \ - fprintf(stderr, _text, ##__VA_ARGS__); \ - fprintf(stderr, "\n"); } while(0); + PX4_WARN("telem> "); \ + PX4_WARN(_text, ##__VA_ARGS__); \ + PX4_WARN("\n"); } while(0); /** * Send a mavlink emergency message and print to console. @@ -129,9 +129,9 @@ __EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...); * @param _text The text to log; */ #define mavlink_and_console_log_info(_fd, _text, ...) do { mavlink_vasprintf(_fd, MAVLINK_IOC_SEND_TEXT_INFO, _text, ##__VA_ARGS__); \ - fprintf(stderr, "telem> "); \ - fprintf(stderr, _text, ##__VA_ARGS__); \ - fprintf(stderr, "\n"); } while(0); + PX4_INFO("telem> "); \ + PX4_INFO(_text, ##__VA_ARGS__); \ + PX4_INFO("\n"); } while(0); struct mavlink_logmessage { char text[MAVLINK_LOG_MAXLEN + 1];