Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Revision 19:14376c221aec, committed 2019-08-20
- Comitter:
- andrewboyson
- Date:
- Tue Aug 20 14:50:12 2019 +0000
- Parent:
- 18:617791ed3d8e
- Child:
- 20:5b5284c60d3c
- Commit message:
- Changed log bytes from char to const uint8_t
Changed in this revision
| log.c | Show annotated file Show diff for this revision Revisions of this file |
| log.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/log.c Thu Jul 25 21:15:03 2019 +0000
+++ b/log.c Tue Aug 20 14:50:12 2019 +0000
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <time.h>
#include <stdbool.h>
+#include <stdint.h>
#include "serialpc.h"
#define BUFFER_LENGTH 0x4000
@@ -217,12 +218,12 @@
LogNibbleAsHex(value >> 4);
LogNibbleAsHex(value >> 0);
}
-void LogBytesAsHex(char* value, int size)
+void LogBytesAsHex(const uint8_t* bytes, int size)
{
int i = 0;
while(true)
{
- LogByteAsHex(value[i]);
+ LogByteAsHex(bytes[i]);
i++;
if (i >= size) break;
if (i % 16 == 0) Log("\r\n");
--- a/log.h Thu Jul 25 21:15:03 2019 +0000 +++ b/log.h Tue Aug 20 14:50:12 2019 +0000 @@ -1,6 +1,7 @@ #include <stdarg.h> #include <time.h> #include <stdbool.h> +#include <stdint.h> extern bool LogUart; extern void LogInit(void (*tmFunction)(struct tm* ptm), int baud); //Set baud to 0 if no serial @@ -21,4 +22,4 @@ extern void LogNibbleAsHex(int nibble); extern void LogByteAsHex(int value); -extern void LogBytesAsHex(char* value, int size); +extern void LogBytesAsHex(const uint8_t* bytes, int size);