Only turn on the column shift register output if we need it.
[uccvend-snackrom.git] / ROM2 / motors.c
index b0e4ee3..ba91ec9 100644 (file)
@@ -24,9 +24,13 @@ void motor_shift_send(u8 data) {
                else
                        bclr_misc_output(A3800_MOTOR_DATA);
 
+               delay(1);
+
                /* clock pulse */
                bset((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_CLOCK);
+               delay(1);
                bclr((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_CLOCK);
+               delay(1);
                
                data = data << 1;
        }
@@ -51,6 +55,7 @@ void motor_on(u8 slot) {
                        break;
                default: /* < 8 */
                        motor_shift_send(1 << col); /* cols from 0..7 */
+                       bclr((void*)&_io_ports[M6811_PORTA], PORTA_MOTOR_COL_DISABLE);
        }
 
        motor_shift_send(1 << (row-1)); /* rows from 1..8 here */
@@ -128,9 +133,12 @@ bool motor_overcurrent() {
 }
 
 u8 dispense_motor(u8 slot) {
-       if (!is_motor(slot)) return MOTOR_NOSLOT;
+       //if (!is_motor(slot)) return MOTOR_NOSLOT;
 
        motor_on(slot);
+       delay(1000);
+       motors_off();
+       return MOTOR_SUCCESS;
        
        if (!left_home(slot)) {
                motors_off();

UCC git Repository :: git.ucc.asn.au