Skip to content

Commit

Permalink
Made board switchable in config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
cprezzi committed Jul 12, 2017
1 parent 54ae403 commit a661778
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 74 deletions.
9 changes: 3 additions & 6 deletions grbl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,17 @@


// Define board type for pin map and default settings.
//#define CPU_MAP_SMOOTHIEBOARD // Smoothieboard (NXP LPC1769 MCU)
#define CPU_MAP_C3D_REMIX // Cohesion3D Remix (NXP LPC1769 MCU)
#define CPU_MAP_SMOOTHIEBOARD // Smoothieboard (NXP LPC1769 MCU)
//#define CPU_MAP_C3D_REMIX // Cohesion3D Remix (NXP LPC1769 MCU)
//#define CPU_MAP_C3D_MINI // Cohesion3D Mini (NXP LPC1769 MCU)
//#define CPU_MAP_MKS_SBASE // MKS SBASE Board (NXP LPC1768 MCU)
//#define CPU_MAP_AZTEEG_X5 // Azteeg X5 boards with NXP LPC1769 mcu
//#define CPU_MAP_AZTEEG_X5 // Azteeg X5 Board (NXP LPC1769 MCU)

// Define machine type for machine specific defaults
//#define DEFAULTS_GENERIC
#define DEFAULTS_K40
//#define DEFAULTS_FABKIT

// For machines with A axis (like rotation axis)
#define ENABLE_A_AXIS

// Serial baud rate
// #define BAUD_RATE 230400
#define BAUD_RATE 115200
Expand Down
88 changes: 20 additions & 68 deletions grbl/cpu_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@
#define X_STEP_BIT 0
#define Y_STEP_BIT 1
#define Z_STEP_BIT 2
#ifdef ENABLE_A_AXIS
#define A_STEP_BIT 3
#endif
//#define B_STEP_BIT 8
//#define C_STEP_BIT 9
#define A_STEP_BIT 3
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)) // All step bits

// Define step direction output pins. NOTE: All direction pins must be on the same port.
Expand All @@ -175,11 +171,7 @@
#define X_DIRECTION_BIT 5
#define Y_DIRECTION_BIT 11
#define Z_DIRECTION_BIT 20
#ifdef ENABLE_A_AXIS
#define A_DIRECTION_BIT 22
#endif
//#define B_DIRECTION_BIT 13
//#define C_DIRECTION_BIT NotUsed
#define A_DIRECTION_BIT 22
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT)) // All direction bits

// Define stepper driver enable/disable output pin.
Expand All @@ -188,11 +180,7 @@
#define X_DISABLE_BIT 4
#define Y_DISABLE_BIT 10
#define Z_DISABLE_BIT 19
#ifdef ENABLE_A_AXIS
#define A_DISABLE_BIT 21
#endif
//#define B_DISABLE_BIT 29
//#define C_DISABLE_BIT NotUsed
#define A_DISABLE_BIT 21
#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)|(1<<A_DISABLE_BIT))

// Define homing/hard limit switch input pins and limit interrupt vectors.
Expand All @@ -203,11 +191,7 @@
#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25
#define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27
#define Z_LIMIT_BIT 29 // Z-MIN=28, Z-MAX=29
#ifdef ENABLE_A_AXIS
#define A_LIMIT_BIT 28 // reuse p1.28, as z-min is not often used
#endif
//#define B_LIMIT_BIT NotUsed
//#define C_LIMIT_BIT NotUsed
#define A_LIMIT_BIT 28 // reuse p1.28, as z-min is not often used
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits

// Define flood and mist coolant enable output pins.
Expand Down Expand Up @@ -282,9 +266,7 @@
#define X_STEP_BIT 0
#define Y_STEP_BIT 1
#define Z_STEP_BIT 2
#ifdef ENABLE_A_AXIS
#define A_STEP_BIT 3
#endif
#define A_STEP_BIT 3
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)) // All step bits

// Define step direction output pins. NOTE: All direction pins must be on the same port.
Expand All @@ -293,9 +275,7 @@
#define X_DIRECTION_BIT 5
#define Y_DIRECTION_BIT 11
#define Z_DIRECTION_BIT 20
#ifdef ENABLE_A_AXIS
#define A_DIRECTION_BIT 22
#endif
#define A_DIRECTION_BIT 22
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT)) // All direction bits

// Define stepper driver enable/disable output pin.
Expand All @@ -304,9 +284,7 @@
#define X_DISABLE_BIT 4
#define Y_DISABLE_BIT 10
#define Z_DISABLE_BIT 19
#ifdef ENABLE_A_AXIS
#define A_DISABLE_BIT 21
#endif
#define A_DISABLE_BIT 21
#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)|(1<<A_DISABLE_BIT))

// Define homing/hard limit switch input pins and limit interrupt vectors.
Expand All @@ -317,9 +295,7 @@
#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25
#define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27
#define Z_LIMIT_BIT 28 // Z-MIN=28, Z-MAX=29
#ifdef ENABLE_A_AXIS
#define A_LIMIT_BIT 29 // reuse p1.29 from Z-MAX
#endif
#define A_LIMIT_BIT 29 // reuse p1.29 from Z-MAX
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits

// Define flood and mist coolant enable output pins.
Expand Down Expand Up @@ -388,9 +364,7 @@
#define X_STEP_BIT 0
#define Y_STEP_BIT 1
#define Z_STEP_BIT 2
#ifdef ENABLE_A_AXIS
#define A_STEP_BIT 3
#endif
#define A_STEP_BIT 3
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)) // All step bits

// Define step direction output pins. NOTE: All direction pins must be on the same port.
Expand All @@ -399,9 +373,7 @@
#define X_DIRECTION_BIT 5
#define Y_DIRECTION_BIT 11
#define Z_DIRECTION_BIT 20
#ifdef ENABLE_A_AXIS
#define A_DIRECTION_BIT 22
#endif
#define A_DIRECTION_BIT 22
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT)) // All direction bits

// Define stepper driver enable/disable output pin.
Expand All @@ -410,9 +382,7 @@
#define X_DISABLE_BIT 4
#define Y_DISABLE_BIT 10
#define Z_DISABLE_BIT 19
#ifdef ENABLE_A_AXIS
#define A_DISABLE_BIT 21
#endif
#define A_DISABLE_BIT 21
#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)|(1<<A_DISABLE_BIT))

// Define homing/hard limit switch input pins and limit interrupt vectors.
Expand All @@ -423,9 +393,7 @@
#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25
#define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27
#define Z_LIMIT_BIT 28 // Z-MIN=28, Z-MAX=29
#ifdef ENABLE_A_AXIS
#define A_LIMIT_BIT 29 // reuse p1.29 from Z-MAX
#endif
#define A_LIMIT_BIT 29 // reuse p1.29 from Z-MAX
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits

// Define flood and mist coolant enable output pins.
Expand Down Expand Up @@ -494,9 +462,7 @@
#define X_STEP_BIT 0
#define Y_STEP_BIT 1
#define Z_STEP_BIT 2
#ifdef ENABLE_A_AXIS
#define A_STEP_BIT 3
#endif
#define A_STEP_BIT 3
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)) // All step bits

// Define step direction output pins. NOTE: All direction pins must be on the same port.
Expand All @@ -505,9 +471,7 @@
#define X_DIRECTION_BIT 5
#define Y_DIRECTION_BIT 11
#define Z_DIRECTION_BIT 20
#ifdef ENABLE_A_AXIS
#define A_DIRECTION_BIT 22
#endif
#define A_DIRECTION_BIT 22
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT)) // All direction bits

// Define stepper driver enable/disable output pin.
Expand All @@ -516,9 +480,7 @@
#define X_DISABLE_BIT 4
#define Y_DISABLE_BIT 10
#define Z_DISABLE_BIT 19
#ifdef ENABLE_A_AXIS
#define A_DISABLE_BIT 21
#endif
#define A_DISABLE_BIT 21
#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)|(1<<A_DISABLE_BIT))

// Define homing/hard limit switch input pins and limit interrupt vectors.
Expand All @@ -529,9 +491,7 @@
#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25
#define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27
#define Z_LIMIT_BIT 29 // Z-MIN=28, Z-MAX=29
#ifdef ENABLE_A_AXIS
#define A_LIMIT_BIT 28 // reuse p1.28, as z-min is not often used
#endif
#define A_LIMIT_BIT 28 // reuse p1.28, as z-min is not often used
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits

// Define flood and mist coolant enable output pins.
Expand Down Expand Up @@ -606,9 +566,7 @@
#define X_STEP_BIT 1
#define Y_STEP_BIT 2
#define Z_STEP_BIT 3
#ifdef ENABLE_A_AXIS
#define A_STEP_BIT 0
#endif
#define A_STEP_BIT 0
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)) // All step bits

// Define step direction output pins. NOTE: All direction pins must be on the same port.
Expand All @@ -617,9 +575,7 @@
#define X_DIRECTION_BIT 11
#define Y_DIRECTION_BIT 20
#define Z_DIRECTION_BIT 22
#ifdef ENABLE_A_AXIS
#define A_DIRECTION_BIT 5
#endif
#define A_DIRECTION_BIT 5
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT)) // All direction bits

// Define stepper driver enable/disable output pin.
Expand All @@ -628,9 +584,7 @@
#define X_DISABLE_BIT 10
#define Y_DISABLE_BIT 19
#define Z_DISABLE_BIT 21
#ifdef ENABLE_A_AXIS
#define A_DISABLE_BIT 4
#endif
#define A_DISABLE_BIT 4
#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)|(1<<A_DISABLE_BIT))

// Define homing/hard limit switch input pins and limit interrupt vectors.
Expand All @@ -641,9 +595,7 @@
#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=27
#define Y_LIMIT_BIT 25 // Y-MIN=25, Y-MAX=28
#define Z_LIMIT_BIT 26 // Z-MIN=26, Z-MAX=29
#ifdef ENABLE_A_AXIS
#define A_LIMIT_BIT 27 // reuse p1.27, as X-MAX is not used
#endif
#define A_LIMIT_BIT 27 // reuse p1.27, as X-MAX is not used
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits

// Define flood and mist coolant enable output pins.
Expand Down

0 comments on commit a661778

Please sign in to comment.