Updated Custom Build Configuration (markdown)

master
Jan Gromeš 2020-06-29 09:58:38 +02:00
rodzic c4e2df6df2
commit d343672015
1 zmienionych plików z 8 dodań i 7 usunięć

@ -1,9 +1,12 @@
# Custom Build Configuration
RadioLib supports many different Arduino cores, but sometimes it may be beneficial to define your own "platform". This can be achieved by frist defining the macro `RADIOLIB_CUSTOM_PLATFORM` and then defining all the required platform specification parameters. All the definitions **MUST** be placed in the Arduino sketch prior to including the main library file RadioLib.h, as is shown in the following example.
RadioLib supports many different Arduino cores, but sometimes it may be beneficial to define your own "platform". This can be achieved by in the [BuildOpt file](https://github.com/jgromes/RadioLib/blob/4ad5261a8333eabb7af332fc60df5e007bf22647/src/BuildOpt.h#L32-L52). First, the macro `RADIOLIB_CUSTOM_PLATFORM`must be defined.
Then, custom configuration can be changed in the section below that macro. Custom platform definition will override automatic platform detection.
```c++
#define RADIOLIB_CUSTOM_PLATFORM
// name for your platform
#define RADIOLIB_PLATFORM "Custom"
// the following parameters must always be defined
#define RADIOLIB_PIN_TYPE uint8_t
@ -15,11 +18,9 @@ RadioLib supports many different Arduino cores, but sometimes it may be benefici
#define RADIOLIB_DEFAULT_SPI SPI
// the following must be defined if the Arduino core does not support SoftwareSerial library
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
//#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
//#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
// the following must be defined if the Arduino core does not support tone function
#define RADIOLIB_TONE_UNSUPPORTED
#include <RadioLib.h>
//#define RADIOLIB_TONE_UNSUPPORTED
```