From 03787d2b284acd88c5f198b56d7c0fad12dcd410 Mon Sep 17 00:00:00 2001 From: Todd Fleming Date: Mon, 2 Jan 2017 22:15:41 -0500 Subject: [PATCH] make globals extern --- grbl/system.h | 14 +++++++------- smoother/src/main.cpp | 10 ++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/grbl/system.h b/grbl/system.h index 0cbea6b..c601193 100644 --- a/grbl/system.h +++ b/grbl/system.h @@ -144,14 +144,14 @@ typedef struct { extern system_t sys; // NOTE: These position variables may need to be declared as volatiles, if problems arise. -int32_t sys_position[N_AXIS]; // Real-time machine (aka home) position vector in steps. -int32_t sys_probe_position[N_AXIS]; // Last probe position in machine coordinates and steps. +extern int32_t sys_position[N_AXIS]; // Real-time machine (aka home) position vector in steps. +extern int32_t sys_probe_position[N_AXIS]; // Last probe position in machine coordinates and steps. -volatile uint8_t sys_probe_state; // Probing state value. Used to coordinate the probing cycle with stepper ISR. -volatile uint8_t sys_rt_exec_state; // Global realtime executor bitflag variable for state management. See EXEC bitmasks. -volatile uint8_t sys_rt_exec_alarm; // Global realtime executor bitflag variable for setting various alarms. -volatile uint8_t sys_rt_exec_motion_override; // Global realtime executor bitflag variable for motion-based overrides. -volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bitflag variable for spindle/coolant overrides. +extern volatile uint8_t sys_probe_state; // Probing state value. Used to coordinate the probing cycle with stepper ISR. +extern volatile uint8_t sys_rt_exec_state; // Global realtime executor bitflag variable for state management. See EXEC bitmasks. +extern volatile uint8_t sys_rt_exec_alarm; // Global realtime executor bitflag variable for setting various alarms. +extern volatile uint8_t sys_rt_exec_motion_override; // Global realtime executor bitflag variable for motion-based overrides. +extern volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bitflag variable for spindle/coolant overrides. #ifdef DEBUG #define EXEC_DEBUG_REPORT bit(0) diff --git a/smoother/src/main.cpp b/smoother/src/main.cpp index 3e62939..7995754 100644 --- a/smoother/src/main.cpp +++ b/smoother/src/main.cpp @@ -1,5 +1,15 @@ +#include "../grbl/grbl.h" #include "mbed.h" +int32_t sys_position[N_AXIS]; // Real-time machine (aka home) position vector in steps. +int32_t sys_probe_position[N_AXIS]; // Last probe position in machine coordinates and steps. + +volatile uint8_t sys_probe_state; // Probing state value. Used to coordinate the probing cycle with stepper ISR. +volatile uint8_t sys_rt_exec_state; // Global realtime executor bitflag variable for state management. See EXEC bitmasks. +volatile uint8_t sys_rt_exec_alarm; // Global realtime executor bitflag variable for setting various alarms. +volatile uint8_t sys_rt_exec_motion_override; // Global realtime executor bitflag variable for motion-based overrides. +volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bitflag variable for spindle/coolant overrides. + DigitalOut myled(LED1); int main() {