Skip to content

Commit

Permalink
Introduce helper methods that can be called from C code. This helps "…
Browse files Browse the repository at this point in the history
…debugging" the rtl_433 at runtime
  • Loading branch information
obones authored and cpainchaud committed May 31, 2023
1 parent fb48489 commit c239347
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions RFLink/99_helper.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "99_helper.h"
#include "3_Serial.h"

extern "C" {

void SerialPrintLn(const char* msg)
{
Serial.println(msg);
}

void SerialPrintMsg(const char* msg)
{
Serial.print(msg);
}

void SerialPrint(int value)
{
Serial.print(value);
}


}
19 changes: 19 additions & 0 deletions RFLink/99_helper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This header is here to allow calling Serial.printXXX methods from C files
* It is most useful when "debugging" the rtl_433 code
*/

#ifndef Helper_H
#define Helper_H

#ifdef __cplusplus
extern "C" {
#endif
void SerialPrintLn(const char* msg);
void SerialPrintMsg(const char* msg);
void SerialPrint(int value);
#ifdef __cplusplus
}
#endif

#endif

0 comments on commit c239347

Please sign in to comment.