examples/sx127x_demo/sx127x_demo.c: RX/TX only if RX/TX enabled (#18)

This commit is contained in:
Mateusz Szafoni 2020-01-16 19:02:25 +01:00 committed by Abdelatif Guettouche
parent b2cd439b10
commit 782a3d25a0

View File

@ -435,7 +435,9 @@ errout:
int main(int argc, FAR char *argv[])
{
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
struct sx127x_read_hdr_s data;
#endif
struct sx127x_chanscan_ioc_s chanscan;
struct args_s *args;
struct timespec tstart;
@ -528,6 +530,7 @@ int main(int argc, FAR char *argv[])
{
switch (args->app_mode)
{
#ifdef CONFIG_LPWAN_SX127X_TXSUPPORT
/* Transmit some data */
case APP_MODE_TX:
@ -543,7 +546,9 @@ int main(int argc, FAR char *argv[])
break;
}
#endif
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
/* Receive data */
case APP_MODE_RX:
@ -579,6 +584,7 @@ int main(int argc, FAR char *argv[])
break;
}
#endif
/* Send some data and wait for response */