Tock: Use \r\n for all new lines
Signed-off-by: Alistair Francis <alistair@alistair23.me>
This commit is contained in:
parent
6a6bb8526b
commit
5750d88797
1 changed files with 6 additions and 6 deletions
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
// the entry point for the program
|
// the entry point for the program
|
||||||
int main(void) {
|
int main(void) {
|
||||||
printf("[SX1261] Initializing ... \n");
|
printf("[SX1261] Initialising Radio ... \r\n");
|
||||||
|
|
||||||
// create a new instance of the HAL class
|
// create a new instance of the HAL class
|
||||||
TockHal* hal = new TockHal();
|
TockHal* hal = new TockHal();
|
||||||
|
@ -51,27 +51,27 @@ int main(void) {
|
||||||
int state = radio->begin(915.0, 125.0, 9, 7, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, 10, 8, 0, false);
|
int state = radio->begin(915.0, 125.0, 9, 7, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, 10, 8, 0, false);
|
||||||
|
|
||||||
if (state != RADIOLIB_ERR_NONE) {
|
if (state != RADIOLIB_ERR_NONE) {
|
||||||
printf("failed, code %d\n", state);
|
printf("failed, code %d\r\n", state);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
printf("success!\n");
|
printf("success!\r\n");
|
||||||
|
|
||||||
// loop forever
|
// loop forever
|
||||||
for(;;) {
|
for(;;) {
|
||||||
yield_no_wait();
|
yield_no_wait();
|
||||||
// send a packet
|
// send a packet
|
||||||
printf("[SX1261] Transmitting packet ... \n");
|
printf("[SX1261] Transmitting '%s' \r\n", transmit_string);
|
||||||
|
|
||||||
state = radio->transmit("Hello World!");
|
state = radio->transmit("Hello World!");
|
||||||
|
|
||||||
if(state == RADIOLIB_ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
// the packet was successfully transmitted
|
// the packet was successfully transmitted
|
||||||
printf("success!\n");
|
printf("success!\r\n");
|
||||||
|
|
||||||
// wait for a second before transmitting again
|
// wait for a second before transmitting again
|
||||||
hal->delay(1000);
|
hal->delay(1000);
|
||||||
} else {
|
} else {
|
||||||
printf("failed, code %d\n", state);
|
printf("failed, code %d\r\n", state);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue