Clean up linkage of struct Modes to actually make sense.

(how did this work before? But it's been unchanged since at least
2013..)

Maybe fixes #65
This commit is contained in:
Oliver Jowett 2020-06-06 21:52:04 +08:00
parent 79c9877232
commit 0793c64ee8
4 changed files with 11 additions and 2 deletions

View File

@ -51,6 +51,8 @@
#include <stdarg.h> #include <stdarg.h>
struct _Modes Modes;
// //
// ============================= Utility functions ========================== // ============================= Utility functions ==========================
// //

View File

@ -295,7 +295,7 @@ struct mag_buf {
}; };
// Program global state // Program global state
struct { // Internal state struct _Modes { // Internal state
pthread_t reader_thread; pthread_t reader_thread;
pthread_mutex_t data_mutex; // Mutex to synchronize buffer access pthread_mutex_t data_mutex; // Mutex to synchronize buffer access
@ -397,7 +397,9 @@ struct { // Internal state
int stats_latest_1min; int stats_latest_1min;
struct stats stats_5min; struct stats stats_5min;
struct stats stats_15min; struct stats stats_15min;
} Modes; };
extern struct _Modes Modes;
// The struct we use to store information about a decoded message. // The struct we use to store information about a decoded message.
struct modesMessage { struct modesMessage {

View File

@ -49,6 +49,8 @@
#include "dump1090.h" #include "dump1090.h"
struct _Modes Modes;
#include <stdarg.h> #include <stdarg.h>
void receiverPositionChanged(float lat, float lon, float alt) void receiverPositionChanged(float lat, float lon, float alt)

View File

@ -28,6 +28,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#include "dump1090.h" #include "dump1090.h"
struct _Modes Modes;
// //
// ============================= Utility functions ========================== // ============================= Utility functions ==========================
// //