trackswitch/main.c

changeset 69
27c0c0095e26
parent 62
66dd5763dfb3
child 70
3a57b7a70683
--- a/trackswitch/main.c	Sat Dec 10 10:51:24 2011 +0100
+++ b/trackswitch/main.c	Sat Dec 10 14:12:09 2011 +0100
@@ -17,12 +17,14 @@
 
 #define PULSE_PORT      PORTD
 #define PULSE_BIT       PD2
-#define RESPONSE_PORT   PORTD
-#define RESPONSE_PIN    PD5
+
+#define RESPONSE_PORT   PORTC
+#define RESPONSE_PIN    PC1
+
 #define SOLENOID_A_PORT PORTB
 #define SOLENOID_B_PORT PORTB
 
-#define TRACKSWITCH_TYPE 2 // 1=double, 2=single
+#define TRACKSWITCH_TYPE 1 // 1=double, 2=single
 
 #define SOLENOID_A_PIN  PB1
 #define SOLENOID_B_PIN  PB2
@@ -67,7 +69,6 @@
     uint8_t enable = DDR(RESPONSE_PORT) | _BV(RESPONSE_PIN);
     uint8_t disable = DDR(RESPONSE_PORT) & ~_BV(RESPONSE_PIN);
     data |= 0b100000000000001; // make sure start/stop bits are set
-    data = 0b1010101010101011;
     while (index != 0) {
         if ((data & 1) != 0) {
             DDR(RESPONSE_PORT) = enable; // enable response output
@@ -248,7 +249,7 @@
     //OSCCAL = 0xa0; // internal oscillator @ 4 mhz.... doesnt work accurate!
 
     RS232_init(); // initialize RS232 interface
-    RS232_puts_p(PSTR("Freeslot TrackSwitch v1.2\n"));
+    RS232_puts_p(PSTR("Freeslot TrackSwitch v1.3\n"));
     sei();
 
 

mercurial