Skip to content

Commit

Permalink
Fix data_logger examples (#37)
Browse files Browse the repository at this point in the history
* Fixing issue with firmware_version()

* Fixing MCC 152 DIO function checks

* Fixing issues causing compile issues in Bullseye

* Updating version history

* Fixing build on Buster after Bullseye changes

* Don't run pip2 if not installed

* Update README.md

* Fix data_logger build issues under Bullseye

* Update version_history.txt

Co-authored-by: Nick Wright <[email protected]>
Co-authored-by: Nick Wright <[email protected]>
Co-authored-by: Saeid Bazazzadeh <[email protected]>
  • Loading branch information
4 people committed Nov 22, 2021
1 parent 9a39afe commit 32be5e1
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 16 deletions.
4 changes: 4 additions & 0 deletions examples/c/mcc118/data_logger/logger/log_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "log_file.h"
#include "errors.h"

// Global data
FILE* log_file_ptr;
char csv_filename[512];

// Function Prototypes
static void get_path_and_filename(char* full_path, char* path, char* filename);
static void check_log_file_error (int status);
Expand Down
5 changes: 3 additions & 2 deletions examples/c/mcc118/data_logger/logger/log_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include <string.h>
#include "logger.h"

FILE* log_file_ptr;
char csv_filename[512];
// Global data
extern FILE* log_file_ptr;
extern char csv_filename[512];

char* choose_log_file(GtkWidget *parent_window, char* default_file_name);
FILE* open_log_file (char* filename);
Expand Down
2 changes: 2 additions & 0 deletions examples/c/mcc118/data_logger/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define READ_ALL_AVAILABLE -1

// Global Variables
GtkWidget *window;
GMainContext *context;
uint8_t g_hat_addr = 0;
uint8_t g_chan_mask;
uint32_t g_sample_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/c/mcc118/data_logger/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "daqhats/daqhats.h"

// Global Variables
GtkWidget *window;
GMainContext *context;
extern GtkWidget *window;
extern GMainContext *context;

#endif // LOGGER_H_INCLUDED
4 changes: 4 additions & 0 deletions examples/c/mcc128/data_logger/logger/log_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "log_file.h"
#include "errors.h"

// Global Variables
FILE* log_file_ptr;
char csv_filename[512];

// Function Prototypes
static void get_path_and_filename(char* full_path, char* path, char* filename);
static void check_log_file_error (int status);
Expand Down
5 changes: 3 additions & 2 deletions examples/c/mcc128/data_logger/logger/log_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include <string.h>
#include "logger.h"

FILE* log_file_ptr;
char csv_filename[512];
// Global Variables
extern FILE* log_file_ptr;
extern char csv_filename[512];

char* choose_log_file(GtkWidget *parent_window, char* default_file_name);
FILE* open_log_file (char* filename);
Expand Down
2 changes: 2 additions & 0 deletions examples/c/mcc128/data_logger/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define READ_ALL_AVAILABLE -1

// Global Variables
GtkWidget *window;
GMainContext *context;
uint8_t g_hat_addr = 0;
uint8_t g_chan_mask;
uint32_t g_sample_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/c/mcc128/data_logger/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "daqhats/daqhats.h"

// Global Variables
GtkWidget *window;
GMainContext *context;
extern GtkWidget *window;
extern GMainContext *context;

#endif // LOGGER_H_INCLUDED
4 changes: 4 additions & 0 deletions examples/c/mcc134/data_logger/logger/log_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "log_file.h"
#include "errors.h"

// Global variables
FILE* log_file_ptr;
char csv_filename[512];

// Function Prototypes
static void get_path_and_filename(char* full_path, char* path, char* filename);
static void check_log_file_error (int status);
Expand Down
5 changes: 3 additions & 2 deletions examples/c/mcc134/data_logger/logger/log_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include <string.h>
#include "logger.h"

FILE* log_file_ptr;
char csv_filename[512];
// Global variables
extern FILE* log_file_ptr;
extern char csv_filename[512];

char* choose_log_file(GtkWidget *parent_window, char* default_file_name);
FILE* open_log_file (char* filename);
Expand Down
2 changes: 2 additions & 0 deletions examples/c/mcc134/data_logger/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define MAX_CHANNELS 4 // MCC134 Channel Count

// Global Variables
GtkWidget *window;
GMainContext *context;
uint8_t g_hat_addr = 0;
uint8_t g_chan_mask;
int g_num_samples = 50;
Expand Down
4 changes: 2 additions & 2 deletions examples/c/mcc134/data_logger/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "daqhats/daqhats.h"

// Global Variables
GtkWidget *window;
GMainContext *context;
extern GtkWidget *window;
extern GMainContext *context;

#endif // LOGGER_H_INCLUDED
4 changes: 4 additions & 0 deletions examples/c/mcc172/data_logger/logger/log_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "log_file.h"
#include "errors.h"

// Global variables
FILE* log_file_ptr;
char csv_filename[512];

// Function Prototypes
static void get_path_and_filename(char* full_path, char* path, char* filename);
static void check_log_file_error (int status);
Expand Down
5 changes: 3 additions & 2 deletions examples/c/mcc172/data_logger/logger/log_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include <string.h>
#include "logger.h"

FILE* log_file_ptr;
char csv_filename[512];
// Global variables
extern FILE* log_file_ptr;
extern char csv_filename[512];

char* choose_log_file(GtkWidget *parent_window, char* default_file_name);
FILE* open_log_file (char* filename);
Expand Down
2 changes: 2 additions & 0 deletions examples/c/mcc172/data_logger/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define READ_ALL_AVAILABLE -1

// Global Variables
GtkWidget *window;
GMainContext *context;
uint8_t g_hat_addr = 0;
uint8_t g_chan_mask;
uint32_t g_sample_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/c/mcc172/data_logger/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "daqhats/daqhats.h"

// Global Variables
GtkWidget *window;
GMainContext *context;
extern GtkWidget *window;
extern GMainContext *context;

#endif // LOGGER_H_INCLUDED
1 change: 1 addition & 0 deletions version_history.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1.4.0.3:
- Added missing checks that mcc152_open() has been called in the MCC 152 DIO functions.
- Fixed issues preventing library building in Bullseye.
- Fixed issues in the C data_logger examples.

1.4.0.2:
- Fixed issue with firmware_version() method in Python for the MCC 128.
Expand Down

0 comments on commit 32be5e1

Please sign in to comment.