config.h: introduce PS_MOSFET_PIN for Sanguish support.
This commit is contained in:
parent
e7b7e004f4
commit
01f7c99881
|
|
@ -258,6 +258,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO9
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN xxxx
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -263,6 +263,7 @@
|
|||
#define SD_WRITE_PROTECT DIO3
|
||||
|
||||
#define PS_ON_PIN DIO14
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN xxxx
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -258,6 +258,7 @@
|
|||
#define E_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN xxxx
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN xxxx
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO15
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO24
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO15
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO25
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -261,6 +261,8 @@
|
|||
//#define E_INVERT_DIR
|
||||
#define E_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN DIO9
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define SD_CARD_DETECT DIO2
|
||||
//#define SD_WRITE_PROTECT DIO3
|
||||
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN xxxx
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN xxxx
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO9
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO4
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@
|
|||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO9
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO14
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
|
|
|
|||
|
|
@ -271,10 +271,6 @@ to use the other 6 PWMs instead.
|
|||
/* starting down the left side for digital, and later down the right for analog */
|
||||
/* General layout: ccw from upper left: stops, heaters, E,Z,Y,X, temp sensors */
|
||||
|
||||
//#define PS_ON_PIN DIO0
|
||||
#define STEPPER_ENABLE_PIN DIO19
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
#define X_STEP_PIN DIO18
|
||||
#define X_DIR_PIN DIO17
|
||||
#define X_MIN_PIN DIO1
|
||||
|
|
@ -311,8 +307,11 @@ to use the other 6 PWMs instead.
|
|||
#define E_INVERT_DIR
|
||||
//#define E_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN DIO0
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO19
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN xxxx
|
||||
//#define SD_CARD_DETECT DIO2
|
||||
//#define SD_WRITE_PROTECT DIO3
|
||||
|
||||
|
|
|
|||
|
|
@ -275,10 +275,6 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
|
|||
/* starting down the left side for digital, and later down the right for analog */
|
||||
/* General layout: ccw from upper left: stops, heaters, E,Z,Y,X, temp sensors */
|
||||
|
||||
//#define PS_ON_PIN DIO0
|
||||
#define STEPPER_ENABLE_PIN DIO26
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
#define X_STEP_PIN DIO25
|
||||
#define X_DIR_PIN DIO24
|
||||
#define X_MIN_PIN DIO2
|
||||
|
|
@ -315,8 +311,11 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
|
|||
#define E_INVERT_DIR
|
||||
//#define E_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN DIO0
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
#define STEPPER_ENABLE_PIN DIO26
|
||||
#define STEPPER_INVERT_ENABLE
|
||||
|
||||
//#define PS_ON_PIN xxxx
|
||||
//#define SD_CARD_DETECT DIO2
|
||||
//#define SD_WRITE_PROTECT DIO3
|
||||
|
||||
|
|
|
|||
3
mendel.c
3
mendel.c
|
|
@ -217,6 +217,9 @@ void init(void) {
|
|||
// reset watchdog
|
||||
wd_reset();
|
||||
|
||||
// prepare the power supply
|
||||
power_init();
|
||||
|
||||
// say hi to host
|
||||
serial_writestr_P(PSTR("start\nok\n"));
|
||||
|
||||
|
|
|
|||
8
pinio.c
8
pinio.c
|
|
@ -14,6 +14,10 @@ void power_on() {
|
|||
SET_OUTPUT(PS_ON_PIN);
|
||||
delay_ms(500);
|
||||
#endif
|
||||
#ifdef PS_MOSFET_PIN
|
||||
WRITE(PS_MOSFET_PIN, 1);
|
||||
delay_ms(10);
|
||||
#endif
|
||||
ps_is_on = 1;
|
||||
}
|
||||
|
||||
|
|
@ -32,5 +36,9 @@ void power_off() {
|
|||
SET_INPUT(PS_ON_PIN);
|
||||
#endif
|
||||
|
||||
#ifdef PS_MOSFET_PIN
|
||||
WRITE(PS_MOSFET_PIN, 0);
|
||||
#endif
|
||||
|
||||
ps_is_on = 0;
|
||||
}
|
||||
|
|
|
|||
8
pinio.h
8
pinio.h
|
|
@ -18,6 +18,14 @@ Power
|
|||
/// It is used inside and outside of interrupts, which is why it has been made volatile
|
||||
extern volatile uint8_t psu_timeout;
|
||||
|
||||
static void power_init(void);
|
||||
inline void power_init(void) {
|
||||
#ifdef PS_MOSFET_PIN
|
||||
WRITE(PS_MOSFET_PIN, 0);
|
||||
SET_OUTPUT(PS_MOSFET_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void power_on(void);
|
||||
void power_off(void);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue