Commit Graph

17 Commits

Author SHA1 Message Date
Peter Barker 33e3d6e254 AP_HAL: Util: make vsnprintf and snprintf always null-terminate
The C++ standard indicates these functions always return a
null-terminated string.  We should rename these functions if we're not
going to conform to the standards.

From https://en.cppreference.com/w/cpp/io/c/vfprintf :

"Writes the results to a character string buffer. At most buf_size-1
characters are written. The resulting character string will be
terminated with a null character"

We are still not standards-compliant in the case a length of 0 is passed
in, returning 0 where we should return the space that would be required
to store the formatted string.
2018-10-21 07:54:30 +11:00
Peter Barker f5eb281efd AP_HAL: use AP_RTC
Also add a define as to whether set_time / get_time can be used
2018-06-15 08:01:22 +10:00
Peter Barker 6c7c916c78 AP_HAL: eliminate AP_HAL::Print and AP_HAL::Stream
Just *way* too many layers involved here
2018-03-23 08:12:38 +11:00
Andrew Tridgell 391affc02d AP_HAL: support ChibiOS 2018-01-15 11:46:02 +11:00
Siddharth Bharat Purohit 807ba9d520 HAL: use correct datatype for time conversion 2017-07-13 18:23:00 -07:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
murata ba60cce0c1 AP_HAL: simplify the processing of milliseconds from the time 2016-10-15 18:33:54 +09:00
Peter Barker e71c71fcac AP_HAL: correct casting of get_system_clock_ms 2016-10-14 18:41:56 +11:00
Siddharth Bharat Purohit 8903bc9eab AP_HAL: add support for get realtime on Darwin systems 2016-07-07 11:35:17 -03:00
Randy Mackay 67620f312d AP_HAL: fix comment for get_time_utc 2016-05-19 16:05:29 +09:00
Niti Rohilla faec752801 AP_HAL: add get_system_clock_utc functions to Util 2016-05-19 16:05:26 +09:00
Lucas De Marchi 520b0384fd AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
Lucas De Marchi a8455aa4e3 AP_HAL: Remove Util::{v,}snprintf_P() 2015-10-30 14:35:06 +09:00
Gustavo Jose de Sousa 0456eccca8 AP_HAL: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Andrew Tridgell efe1e01700 AP_HAL: require a buffer write() function in all ports
this makes a sufficient performance difference that it is worth it
2013-10-03 12:21:07 +10:00
Andrew Tridgell 0d662c52b3 AP_HAL: fixed length return from snprintf 2013-09-21 15:45:05 +10:00
Andrew Tridgell 0063f1fad8 AP_HAL: added Util.cpp
common printf functions
2013-09-21 14:25:42 +10:00