power_on(): add a delay when powering on.
This allows the PSU to come up before we get step losses if we step immediately.
This commit is contained in:
parent
3b4953a631
commit
eb734b173d
17
pinio.c
17
pinio.c
|
|
@ -1,11 +1,18 @@
|
||||||
#include "pinio.h"
|
#include "pinio.h"
|
||||||
|
#include "delay.h"
|
||||||
|
|
||||||
|
static char ps_is_on = 0;
|
||||||
|
|
||||||
void power_on() {
|
void power_on() {
|
||||||
|
|
||||||
#ifdef PS_ON_PIN
|
if (ps_is_on == 0) {
|
||||||
WRITE(PS_ON_PIN, 0);
|
#ifdef PS_ON_PIN
|
||||||
SET_OUTPUT(PS_ON_PIN);
|
WRITE(PS_ON_PIN, 0);
|
||||||
#endif
|
SET_OUTPUT(PS_ON_PIN);
|
||||||
|
_delay_ms(500);
|
||||||
|
#endif
|
||||||
|
ps_is_on = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void power_off() {
|
void power_off() {
|
||||||
|
|
@ -19,4 +26,6 @@ void power_off() {
|
||||||
#ifdef PS_ON_PIN
|
#ifdef PS_ON_PIN
|
||||||
SET_INPUT(PS_ON_PIN);
|
SET_INPUT(PS_ON_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ps_is_on = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue