Skip to content

Commit

Permalink
Fix interupts and pin debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityAutomation committed Jan 19, 2024
1 parent 6087ab6 commit 0316242
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
#define X_DRIVER_TYPE TB6560
#define Y_DRIVER_TYPE TB6560
#define Z_DRIVER_TYPE TB6560
#define X_DRIVER_TYPE TB6600
#define Y_DRIVER_TYPE TB6600
#define Z_DRIVER_TYPE TB6600
//#define X2_DRIVER_TYPE A4988
#define Y2_DRIVER_TYPE TB6560
#define Z2_DRIVER_TYPE TB6560
#define Z3_DRIVER_TYPE TB6560
#define Z4_DRIVER_TYPE TB6560
#define Y2_DRIVER_TYPE TB6600
#define Z2_DRIVER_TYPE TB6600
#define Z3_DRIVER_TYPE TB6600
#define Z4_DRIVER_TYPE TB6600
//#define I_DRIVER_TYPE A4988
//#define J_DRIVER_TYPE A4988
//#define K_DRIVER_TYPE A4988
Expand Down Expand Up @@ -392,7 +392,7 @@
* Enable and connect the power supply to the PS_ON_PIN.
* Specify whether the power supply is active HIGH or active LOW.
*/
#define PSU_CONTROL
//#define PSU_CONTROL
//#define PSU_NAME "Power Supply"

#if ENABLED(PSU_CONTROL)
Expand Down Expand Up @@ -1177,9 +1177,9 @@
* Endstop "Hit" State
* Set to the state (HIGH or LOW) that applies to each endstop.
*/
#define X_MIN_ENDSTOP_HIT_STATE HIGH
#define X_MIN_ENDSTOP_HIT_STATE LOW
#define X_MAX_ENDSTOP_HIT_STATE HIGH
#define Y_MIN_ENDSTOP_HIT_STATE HIGH
#define Y_MIN_ENDSTOP_HIT_STATE LOW
#define Y_MAX_ENDSTOP_HIT_STATE HIGH
#define Z_MIN_ENDSTOP_HIT_STATE HIGH
#define Z_MAX_ENDSTOP_HIT_STATE HIGH
Expand Down
6 changes: 3 additions & 3 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@
*
* :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
*/
//#define SDCARD_CONNECTION LCD
#define SDCARD_CONNECTION ONBOARD

// Enable if SD detect is rendered useless (e.g., by using an SD extender)
//#define NO_SD_DETECT
Expand Down Expand Up @@ -2565,7 +2565,7 @@
*
* Override the default value based on the driver type set in Configuration.h.
*/
//#define MINIMUM_STEPPER_PULSE 2
#define MINIMUM_STEPPER_PULSE 10

/**
* Maximum stepping rate (in Hz) the stepper driver allows
Expand All @@ -2579,7 +2579,7 @@
*
* Override the default value based on the driver type set in Configuration.h.
*/
//#define MAXIMUM_STEPPER_RATE 250000
#define MAXIMUM_STEPPER_RATE 150000

// @section temperature

Expand Down
11 changes: 10 additions & 1 deletion Marlin/src/HAL/LPC4078/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ extern DefaultSerial1 USBSerial;

#define CRITICAL_SECTION_START() const bool irqon = !MCUCore::primask(); MCUCore::nvic_interrupts_disable()
#define CRITICAL_SECTION_END() if (irqon) MCUCore::nvic_interrupts_enable()

#define cli() noInterrupts()
#define sei() interrupts()
//
// ADC
//
Expand Down Expand Up @@ -143,6 +144,14 @@ constexpr int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t pin) {
return (MCUI::pin_is_valid(pin) && MCUI::pin_has_adc(pin)) ? pin : -1;
}

//
// Misc. Functions
//
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) (p)
#endif


// Return the index of a pin number
constexpr int16_t GET_PIN_MAP_INDEX(const pin_t pin) {
return MCUI::pin_index(pin);
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/pins/lpc4078/pins_EBAB.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

// EXTRA PINS
#define FIL_RUNOUT_PIN P1_12
#define PS_ON_PIN P3_15

// DRIVERS EXTRA PINS
#define DRIVERS_SCK P1_20
Expand Down Expand Up @@ -234,7 +233,7 @@
#endif

#ifndef PS_ON_PIN
#define PS_ON_PIN P_NC
//#define PS_ON_PIN P_NC
#endif

//
Expand Down
3 changes: 2 additions & 1 deletion ini/lpc176x.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ lib_deps = ${common.lib_deps}
custom_marlin.USES_LIQUIDCRYSTAL = arduino-libraries/LiquidCrystal@~1.0.7
custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip
build_flags = ${common.build_flags} -DU8G_HAL_LINKS -DPLATFORM_M997_SUPPORT
-IMarlin/src/HAL/LPC1768/include -IMarlin/src/HAL/LPC1768/u8g
-IMarlin/src/HAL/LPC1768/include -IMarlin/src/HAL/LPC1768/u8g -O3
build_unflags = -Os
# debug options for backtrace
#-funwind-tables
#-mpoke-function-name
Expand Down

0 comments on commit 0316242

Please sign in to comment.