diff --git a/Repetier/Configuration.h b/Repetier/Configuration.h index 1a48a7976..7cf04eb4d 100644 --- a/Repetier/Configuration.h +++ b/Repetier/Configuration.h @@ -946,5 +946,8 @@ and it is elsewise difficult to know, what your reprap is currently doing. */ /** \brief Defines the default z scale */ #define DEFAULT_Z_SCALE_MODE Z_VALUE_MODE_Z_MIN +/** \brief For Nibbels external interrupt 3 button at RF1000 X25.8 und RF2000 X34.2 "EXT_IRQ"/INT3 +You can activate this to 1 and connect some Button. If you connect ground to pull the pullup down you will let the firmware jump into interrupt routine */ +#define FEATURE_USER_INT3 0 // 0 = OFF, 1 = ON #endif // CONFIGURATION_H diff --git a/Repetier/HAL.cpp b/Repetier/HAL.cpp index 3bfc78bfe..ffb15596e 100644 --- a/Repetier/HAL.cpp +++ b/Repetier/HAL.cpp @@ -1207,6 +1207,14 @@ ISR(EXTRUDER_TIMER_VECTOR) } #endif // USE_ADVANCE +#if FEATURE_USER_INT3 +volatile unsigned long g_uCOUNT_INT3 = 0; //dummy variable for dummy function! + +void USER_INTERRUPT3_HOOK(){ + g_uCOUNT_INT3++; //dummy function! +} +#endif //FEATURE_USER_INT3 + #ifndef EXTERNALSERIAL // Implement serial communication for one stream only! /* diff --git a/Repetier/HAL.h b/Repetier/HAL.h index 3d3c2e2e6..b5cbadbd7 100644 --- a/Repetier/HAL.h +++ b/Repetier/HAL.h @@ -122,6 +122,12 @@ typedef uint8_t flag8_t; #define FAST_INTEGER_SQRT +#if FEATURE_USER_INT3 +extern volatile unsigned long g_uCOUNT_INT3; //dummy variable for dummy function! + +void USER_INTERRUPT3_HOOK(); //dummy function! +#endif //FEATURE_USER_INT3 + #ifndef EXTERNALSERIAL // Implement serial communication for one stream only! /* @@ -204,7 +210,7 @@ class RFHardwareSerial : public Print extern RFHardwareSerial RFSerial; #define RFSERIAL RFSerial #define WAIT_OUT_EMPTY while(tx_buffer.head != tx_buffer.tail) {} -#else +#else // EXTERNALSERIAL #define RFSERIAL Serial #endif // EXTERNALSERIAL diff --git a/Repetier/Printer.cpp b/Repetier/Printer.cpp index 0b7328795..0224636dc 100644 --- a/Repetier/Printer.cpp +++ b/Repetier/Printer.cpp @@ -898,6 +898,12 @@ void Printer::setup() #endif // Z_MAX_PIN>-1 #endif // MAX_HARDWARE_ENDSTOP_Z +#if FEATURE_USER_INT3 + SET_INPUT( RESERVE_DIGITAL_PIN_PD3 ); + PULLUP( RESERVE_DIGITAL_PIN_PD3, HIGH ); + attachInterrupt( digitalPinToInterrupt(RESERVE_DIGITAL_PIN_PD3) , USER_INTERRUPT3_HOOK, FALLING ); +#endif //FEATURE_USER_INT3 + #if FAN_PIN>-1 SET_OUTPUT(FAN_PIN); WRITE(FAN_PIN,LOW); diff --git a/Repetier/RF.cpp b/Repetier/RF.cpp index 32a124112..bbfc255ca 100644 --- a/Repetier/RF.cpp +++ b/Repetier/RF.cpp @@ -10698,6 +10698,13 @@ void processCommand( GCode* pCommand ) break; } +#if FEATURE_USER_INT3 + case 3989: // M3989 : proof that dummy function/additional hardware button works! + { + Com::printFLN( PSTR( "Request INT3:" ), g_uCOUNT_INT3 ); //evtl. je nach Anwendung entprellen nötig: wenn entprellen nötig, hilft evtl. interrupt nach ausführung sperren und mit dem watchdog-timer erneut entsperren. + break; + } +#endif //FEATURE_USER_INT3 } } diff --git a/Repetier/pins.h b/Repetier/pins.h index 387044531..bc7d83329 100644 --- a/Repetier/pins.h +++ b/Repetier/pins.h @@ -253,15 +253,15 @@ #define FET3 -1 //http://www.rf1000.de/viewtopic.php?f=24&t=1119 : -#define RESERVE_DIGITAL_PIN_PJ0 15 //RF1000 X25.12 und RF2000 X33.3 -#define RESERVE_DIGITAL_PIN_PJ1 14 //RF1000 X25.13 und RF2000 X33.4 +#define RESERVE_DIGITAL_PIN_PJ0 15 //RF1000 X25.12 und RF2000 X33.3 //Serial3 RX3 +#define RESERVE_DIGITAL_PIN_PJ1 14 //RF1000 X25.13 und RF2000 X33.4 //Serial3 TX3 #define RESERVE_DIGITAL_PIN_PC2 35 //X25.4 #define RESERVE_DIGITAL_PIN_PC4 33 //X25.5 #define RESERVE_DIGITAL_PIN_PC5 32 //X25.6 #define RESERVE_DIGITAL_PIN_PD2 19 //X25.7 -#define RESERVE_DIGITAL_PIN_PD3 18 //RF1000 X25.8 und RF2000 X34.2 "EXT_IRQ" +#define RESERVE_DIGITAL_PIN_PD3 18 //RF1000 X25.8 und RF2000 X34.2 "EXT_IRQ"/INT3 -> FEATURE_USER_INT3 #define RESERVE_ANALOG_PIN_PF3 3 //X25.10 #define RESERVE_ANALOG_PIN_PF4 4 //X25.11 @@ -502,12 +502,12 @@ #define UI_DISPLAY_D7_PIN 98 // PINJ.3, 66, D_D7 -#define RESERVE_DIGITAL_PIN_PJ0 15 //RF1000 X25.12 und RF2000 X33.3 -#define RESERVE_DIGITAL_PIN_PJ1 14 //RF1000 X25.13 und RF2000 X33.4 +#define RESERVE_DIGITAL_PIN_PJ0 15 //RF1000 X25.12 und RF2000 X33.3 //Serial3 RX3 +#define RESERVE_DIGITAL_PIN_PJ1 14 //RF1000 X25.13 und RF2000 X33.4 //Serial3 TX3 #define RESERVE_DIGITAL_PIN_PE4 2 //RF2000 X33.5 -#define RESERVE_DIGITAL_PIN_PD3 18 //RF1000 X25.8 und RF2000 X34.2 "EXT_IRQ" +#define RESERVE_DIGITAL_PIN_PD3 18 //RF1000 X25.8 und RF2000 X34.2 "EXT_IRQ"/INT3 -> FEATURE_USER_INT3 /* X34.3=SCL und X34.4=SDA ist I²C siehe wire.h. (X34.1=5V und X34.5/X34.6=VSS) An diesem Bus sind auch die DMS und EEPROMs für Geräteidentifikation (EEPROM 2) und das EEPROM für die Z-Matrix (EEPROM 1) angeschlossen. */ #endif // MOTHERBOARD == DEVICE_TYPE_RF2000