Skip to content

Commit 6c0fbe1

Browse files
committed
Updated for core changes.
1 parent 8c3fcff commit 6c0fbe1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cnc_boosterpack_map.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
#define RESET_PIN BIT5
115115
#define FEED_HOLD_PIN BIT3
116116
#define CYCLE_START_PIN BIT2
117-
#define SAFETY_DOOR_PIN BIT4
118117
#define CONTROL_PORT_OUT portOut(CONTROL_PORT)
119118
#define CONTROL_PORT_IN portIn(CONTROL_PORT)
120119
#define CONTROL_PORT_DIR portDir(CONTROL_PORT)
@@ -123,7 +122,12 @@
123122
#define CONTROL_PORT_IES portEs(CONTROL_PORT)
124123
#define CONTROL_PORT_IFG portIfg(CONTROL_PORT)
125124
#define CONTROL_PORT_VECTOR portInt(CONTROL_PORT)
125+
#if SAFETY_DOOR_ENABLE
126+
#define SAFETY_DOOR_PIN BIT4
126127
#define HWCONTROL_MASK (RESET_PIN|FEED_HOLD_PIN|CYCLE_START_PIN|SAFETY_DOOR_PIN)
128+
#else
129+
#define HWCONTROL_MASK (RESET_PIN|FEED_HOLD_PIN|CYCLE_START_PIN)
130+
#endif
127131

128132
// Define probe switch input pin.
129133
#define PROBE_PORT 2

driver.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,10 @@ static void settings_changed (settings_t *settings)
455455
control_signals_t control_ies;
456456
control_ies.mask = ~(settings->control_disable_pullup.mask ^ settings->control_invert.mask);
457457

458+
#ifdef SAFETY_DOOR_PIN
458459
CONTROL_PORT_IE &= ~HWCONTROL_MASK; // Disable control pins change interrupt
459460
CONTROL_PORT_DIR &= ~HWCONTROL_MASK; // Disable control pins change interrupt
461+
#endif
460462

461463
if(settings->control_disable_pullup.cycle_start)
462464
CONTROL_PORT_OUT &= ~CYCLE_START_PIN;
@@ -473,10 +475,12 @@ static void settings_changed (settings_t *settings)
473475
else
474476
CONTROL_PORT_OUT |= RESET_PIN;
475477

478+
#ifdef SAFETY_DOOR_PIN
476479
if(settings->control_disable_pullup.safety_door_ajar)
477480
CONTROL_PORT_OUT &= ~SAFETY_DOOR_PIN;
478481
else
479482
CONTROL_PORT_OUT |= SAFETY_DOOR_PIN;
483+
#endif
480484

481485
if(control_ies.cycle_start)
482486
CONTROL_PORT_IES &= ~CYCLE_START_PIN;
@@ -493,10 +497,12 @@ static void settings_changed (settings_t *settings)
493497
else
494498
CONTROL_PORT_IES |= RESET_PIN;
495499

500+
#ifdef SAFETY_DOOR_PIN
496501
if(control_ies.safety_door_ajar)
497502
CONTROL_PORT_IES &= ~SAFETY_DOOR_PIN;
498503
else
499504
CONTROL_PORT_IES |= SAFETY_DOOR_PIN;
505+
#endif
500506

501507
CONTROL_PORT_REN |= HWCONTROL_MASK; // Enable pull-ups/pull-down,
502508
CONTROL_PORT_IFG &= ~HWCONTROL_MASK; // clear any pending interrupt
@@ -672,7 +678,7 @@ bool driver_init (void)
672678
SYSTICK_TIMER_CCTL0 |= CCIE;
673679

674680
hal.info = "MSP430F5529";
675-
hal.driver_version = "211121";
681+
hal.driver_version = "211126";
676682
hal.driver_setup = driver_setup;
677683
hal.f_step_timer = 24000000;
678684
hal.rx_buffer_size = RX_BUFFER_SIZE;

0 commit comments

Comments
 (0)