kopia lustrzana https://github.com/cariboulabs/cariboulite
fixed signal handler pigpio
rodzic
8a3cd61906
commit
a3b4bc0fb1
20796
firmware/top.asc
20796
firmware/top.asc
Plik diff jest za duży
Load Diff
BIN
firmware/top.bin
BIN
firmware/top.bin
Plik binarny nie jest wyświetlany.
15901
firmware/top.json
15901
firmware/top.json
Plik diff jest za duży
Load Diff
|
@ -90,6 +90,10 @@ typedef enum
|
|||
at86rf215_radio_rx_bw_BW1250KHZ_IF2000KHZ = 0x9, // at86rf215_radio_rx_f_cut_0_75_half_fs
|
||||
at86rf215_radio_rx_bw_BW1600KHZ_IF2000KHZ = 0xA, // at86rf215_radio_rx_f_cut_half_fs
|
||||
at86rf215_radio_rx_bw_BW2000KHZ_IF2000KHZ = 0xB, // at86rf215_radio_rx_f_cut_half_fs
|
||||
at86rf215_radio_rx_bw_BW2000KHZ_IFCCKHZ = 0xC, // **
|
||||
at86rf215_radio_rx_bw_BW2000KHZ_IFDDHZ = 0xD, // **
|
||||
at86rf215_radio_rx_bw_BW2000KHZ_IFEEKHZ = 0xE, // **
|
||||
at86rf215_radio_rx_bw_BW2000KHZ_IFFFKHZ = 0xF, // **
|
||||
} at86rf215_radio_rx_bw_en;
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -111,6 +111,10 @@ typedef enum
|
|||
#define RF_BW1250KHZ_IF2000KHZ 0x09
|
||||
#define RF_BW1600KHZ_IF2000KHZ 0x0A
|
||||
#define RF_BW2000KHZ_IF2000KHZ 0x0B
|
||||
#define RF_BW2000KHZ_IFCCKHZ 0x0C
|
||||
#define RF_BW2000KHZ_IFDDHZ 0x0D
|
||||
#define RF_BW2000KHZ_IFEEKHZ 0x0E
|
||||
#define RF_BW2000KHZ_IFFFKHZ 0x0F
|
||||
|
||||
/* different Skew values */
|
||||
#define RF_IQ_SKEW_pos_2 0x00
|
||||
|
|
|
@ -84,8 +84,8 @@ int caribou_smi_init(caribou_smi_st* dev, caribou_smi_error_callback error_cb, v
|
|||
return -1;
|
||||
}
|
||||
|
||||
ZF_LOGD("Current SMI Settings:");
|
||||
caribou_smi_print_smi_settings(&settings);
|
||||
//ZF_LOGD("Current SMI Settings:");
|
||||
//caribou_smi_print_smi_settings(&settings);
|
||||
|
||||
// set the address to idle
|
||||
ret = ioctl(fd, BCM2835_SMI_IOC_ADDRESS, caribou_smi_address_idle);
|
||||
|
|
|
@ -323,8 +323,8 @@ int cariboulite_release_submodules(cariboulite_st* sys)
|
|||
//=================================================
|
||||
int cariboulite_init_driver(cariboulite_st *sys, void* signal_handler_cb, cariboulite_board_info_st *info)
|
||||
{
|
||||
zf_log_set_output_level(ZF_LOG_ERROR);
|
||||
//zf_log_set_output_level(ZF_LOG_VERBOSE);
|
||||
//zf_log_set_output_level(ZF_LOG_ERROR);
|
||||
zf_log_set_output_level(ZF_LOG_VERBOSE);
|
||||
|
||||
ZF_LOGI("driver initializing");
|
||||
if (info == NULL)
|
||||
|
|
|
@ -5644,10 +5644,16 @@ static void sigHandler(int signum)
|
|||
{
|
||||
// Added David Michaeli
|
||||
int res = -1;
|
||||
|
||||
// first check if there is a signal handler from the application
|
||||
if (unhandled_signal_from_app != NULL)
|
||||
{
|
||||
res = unhandled_signal_from_app(signum);
|
||||
}
|
||||
|
||||
// if there is no signal handler (==NULL) or
|
||||
// the sighandler from the app didn't handle the signal itself
|
||||
// then let pigpio handle the signal itself
|
||||
if (res != 0)
|
||||
{
|
||||
DBG(DBG_ALWAYS, "Unhandled signal %d, terminating\n", signum);
|
||||
|
|
|
@ -308,6 +308,12 @@ static at86rf215_radio_rx_bw_en convertRxBandwidth(double bw_numeric)
|
|||
if (fabs(bw_numeric - (1250000*fact)) < 1) return at86rf215_radio_rx_bw_BW1250KHZ_IF2000KHZ;
|
||||
if (fabs(bw_numeric - (1600000*fact)) < 1) return at86rf215_radio_rx_bw_BW1600KHZ_IF2000KHZ;
|
||||
if (fabs(bw_numeric - (2000000*fact)) < 1) return at86rf215_radio_rx_bw_BW2000KHZ_IF2000KHZ;
|
||||
|
||||
if (fabs(bw_numeric - (2500000*fact)) < 1) return at86rf215_radio_rx_bw_BW2000KHZ_IFCCKHZ;
|
||||
if (fabs(bw_numeric - (3000000*fact)) < 1) return at86rf215_radio_rx_bw_BW2000KHZ_IFDDHZ;
|
||||
if (fabs(bw_numeric - (4000000*fact)) < 1) return at86rf215_radio_rx_bw_BW2000KHZ_IFEEKHZ;
|
||||
if (fabs(bw_numeric - (5000000*fact)) < 1) return at86rf215_radio_rx_bw_BW2000KHZ_IFFFKHZ;
|
||||
|
||||
return at86rf215_radio_rx_bw_BW2000KHZ_IF2000KHZ;
|
||||
}
|
||||
|
||||
|
@ -327,6 +333,12 @@ static double convertRxBandwidth(at86rf215_radio_rx_bw_en bw_en)
|
|||
if (at86rf215_radio_rx_bw_BW1250KHZ_IF2000KHZ == bw_en) return 1250000 * fact;
|
||||
if (at86rf215_radio_rx_bw_BW1600KHZ_IF2000KHZ == bw_en) return 1600000 * fact;
|
||||
if (at86rf215_radio_rx_bw_BW2000KHZ_IF2000KHZ == bw_en) return 2000000 * fact;
|
||||
|
||||
if (at86rf215_radio_rx_bw_BW2000KHZ_IFCCKHZ == bw_en) return 2500000 * fact;
|
||||
if (at86rf215_radio_rx_bw_BW2000KHZ_IFDDHZ == bw_en) return 3000000 * fact;
|
||||
if (at86rf215_radio_rx_bw_BW2000KHZ_IFEEKHZ == bw_en) return 4000000 * fact;
|
||||
if (at86rf215_radio_rx_bw_BW2000KHZ_IFFFKHZ == bw_en) return 5000000 * fact;
|
||||
|
||||
return 2000000 * fact;
|
||||
}
|
||||
|
||||
|
@ -424,6 +436,11 @@ std::vector<double> Cariboulite::listBandwidths( const int direction, const size
|
|||
options.push_back( 1250000*fact );
|
||||
options.push_back( 1600000*fact );
|
||||
options.push_back( 2000000*fact );
|
||||
|
||||
options.push_back( 2500000*fact );
|
||||
options.push_back( 3000000*fact );
|
||||
options.push_back( 4000000*fact );
|
||||
options.push_back( 5000000*fact );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -86,7 +86,9 @@ public:
|
|||
~SoapyCaribouliteSession(void);
|
||||
|
||||
public:
|
||||
cariboulite_st cariboulite_sys;
|
||||
static cariboulite_st cariboulite_sys;
|
||||
static std::mutex sessionMutex;
|
||||
static size_t sessionCount;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -5,26 +5,33 @@
|
|||
#include <mutex>
|
||||
#include <cstddef>
|
||||
|
||||
std::mutex SoapyCaribouliteSession::sessionMutex;
|
||||
size_t SoapyCaribouliteSession::sessionCount = 0;
|
||||
cariboulite_st SoapyCaribouliteSession::cariboulite_sys = {0};
|
||||
|
||||
//========================================================
|
||||
int soapy_sighandler(int signum)
|
||||
{
|
||||
SoapySDR_logf(SOAPY_SDR_DEBUG, "Received signal %d", signum);
|
||||
switch (signum)
|
||||
{
|
||||
case SIGINT: printf("Caught SIGINT\n"); break;
|
||||
case SIGTERM: printf("Caught SIGTERM\n"); break;
|
||||
case SIGABRT: printf("Caught SIGABRT\n"); break;
|
||||
case SIGILL: printf("Caught SIGILL\n"); break;
|
||||
case SIGSEGV: printf("Caught SIGSEGV\n"); break;
|
||||
case SIGFPE: printf("Caught SIGFPE\n"); break;
|
||||
default: printf("Caught Unknown Signal %d\n", signum); return -1; break;
|
||||
case SIGINT: printf("soapy_sighandler caught SIGINT\n"); break;
|
||||
case SIGTERM: printf("soapy_sighandler caught SIGTERM\n"); break;
|
||||
case SIGABRT: printf("soapy_sighandler caught SIGABRT\n"); break;
|
||||
case SIGILL: printf("soapy_sighandler caught SIGILL\n"); break;
|
||||
case SIGSEGV: printf("soapy_sighandler caught SIGSEGV\n"); break;
|
||||
case SIGFPE: printf("soapy_sighandler caught SIGFPE\n"); break;
|
||||
default: printf("soapy_sighandler caught Unknown Signal %d\n", signum); return -1; break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
printf("soapy_sighandler killing soapy_cariboulite (cariboulite_release_driver)\n");
|
||||
std::lock_guard<std::mutex> lock(SoapyCaribouliteSession::sessionMutex);
|
||||
cariboulite_release_driver(&(SoapyCaribouliteSession::cariboulite_sys));
|
||||
SoapyCaribouliteSession::sessionCount = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static std::mutex sessionMutex;
|
||||
static size_t sessionCount = 0;
|
||||
|
||||
|
||||
SoapyCaribouliteSession::SoapyCaribouliteSession(void)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue