|
@@ -20,7 +20,6 @@ along with this program. If not, see <http:
|
|
|
#include QMK_KEYBOARD_H
|
|
|
#include "protocol/serial.h"
|
|
|
#include "timer.h"
|
|
|
-#include "pincontrol.h"
|
|
|
|
|
|
|
|
|
|
|
@@ -96,27 +95,27 @@ void pins_init(void) {
|
|
|
|
|
|
|
|
|
|
|
|
- pinMode(VCC_PIN, PinDirectionOutput);
|
|
|
- digitalWrite(VCC_PIN, PinLevelLow);
|
|
|
+ setPinOutput(VCC_PIN);
|
|
|
+ writePinLow(VCC_PIN);
|
|
|
|
|
|
#if ( HANDSPRING == 0)
|
|
|
|
|
|
#ifdef CY835
|
|
|
- pinMode(GND_PIN, PinDirectionOutput);
|
|
|
- digitalWrite(GND_PIN, PinLevelLow);
|
|
|
+ setPinOutput(GND_PIN);
|
|
|
+ writePinLow(GND_PIN);
|
|
|
|
|
|
- pinMode(PULLDOWN_PIN, PinDirectionOutput);
|
|
|
- digitalWrite(PULLDOWN_PIN, PinLevelLow);
|
|
|
+ setPinOutput(PULLDOWN_PIN);
|
|
|
+ writePinLow(PULLDOWN_PIN);
|
|
|
#endif
|
|
|
|
|
|
- pinMode(DCD_PIN, PinDirectionInput);
|
|
|
- pinMode(RTS_PIN, PinDirectionInput);
|
|
|
+ setPinInput(DCD_PIN);
|
|
|
+ setPinInput(RTS_PIN);
|
|
|
#endif
|
|
|
|
|
|
|
|
|
- test=digitalRead(DCD_PIN);
|
|
|
+ test=readPin(DCD_PIN);
|
|
|
xprintf("b%02X:", test);
|
|
|
- test=digitalRead(RTS_PIN);
|
|
|
+ test=readPin(RTS_PIN);
|
|
|
xprintf("%02X\n", test);
|
|
|
*/
|
|
|
|
|
@@ -129,20 +128,20 @@ uint8_t rts_reset(void) {
|
|
|
|
|
|
|
|
|
|
|
|
- firstread=digitalRead(RTS_PIN);
|
|
|
+ firstread=readPin(RTS_PIN);
|
|
|
|
|
|
|
|
|
- pinMode(RTS_PIN, PinDirectionOutput);
|
|
|
+ setPinOutput(RTS_PIN);
|
|
|
|
|
|
- if (firstread == PinLevelHigh) {
|
|
|
- digitalWrite(RTS_PIN, PinLevelLow);
|
|
|
+ if (firstread) {
|
|
|
+ writePinLow(RTS_PIN);
|
|
|
}
|
|
|
_delay_ms(10);
|
|
|
- digitalWrite(RTS_PIN, PinLevelHigh);
|
|
|
+ writePinHigh(RTS_PIN);
|
|
|
|
|
|
|
|
|
|
|
|
- if (palReadPad(RTS_PIN_IOPRT) == PinLevelLow)
|
|
|
+ if (!palReadPad(RTS_PIN_IOPRT))
|
|
|
{
|
|
|
_delay_ms(10);
|
|
|
palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL);
|
|
@@ -224,9 +223,9 @@ uint8_t handspring_handshake(void) {
|
|
|
}
|
|
|
|
|
|
uint8_t handspring_reset(void) {
|
|
|
- digitalWrite(VCC_PIN, PinLevelLow);
|
|
|
+ writePinLow(VCC_PIN);
|
|
|
_delay_ms(5);
|
|
|
- digitalWrite(VCC_PIN, PinLevelHigh);
|
|
|
+ writePinHigh(VCC_PIN);
|
|
|
|
|
|
if ( handspring_handshake() ) {
|
|
|
last_activity = timer_read();
|
|
@@ -250,7 +249,7 @@ void matrix_init(void)
|
|
|
#endif
|
|
|
|
|
|
print("power up\n");
|
|
|
- digitalWrite(VCC_PIN, PinLevelHigh);
|
|
|
+ writePinHigh(VCC_PIN);
|
|
|
|
|
|
|
|
|
|
|
@@ -265,7 +264,7 @@ void matrix_init(void)
|
|
|
}
|
|
|
|
|
|
#else
|
|
|
- while( digitalRead(DCD_PIN) != PinLevelHigh ) {;}
|
|
|
+ while( !readPin(DCD_PIN) ) {;}
|
|
|
print("dcd\n");
|
|
|
|
|
|
rts_reset();
|