X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=ROM2%2Fmotors.h;h=a18e4b2e6b13bd4d55c04a62301f4e43f8f3197d;hb=dc05db765d0f5d7e68f6c786f0572c0da4d7926d;hp=c38e90848faebeb8191e0023eccec53728873108;hpb=05333de42083420af87bbd629e90956231dc963c;p=uccvend-snackrom.git diff --git a/ROM2/motors.h b/ROM2/motors.h index c38e908..a18e4b2 100644 --- a/ROM2/motors.h +++ b/ROM2/motors.h @@ -1,8 +1,30 @@ #ifndef _MOTORS_H_ #define _MOTORS_H_ +#include "vend.h" + +/* error codes for dispense_motor */ +#define MOTOR_SUCCESS 0 +#define MOTOR_NOSLOT 1 +#define MOTOR_HOME_FAIL 2 +#define MOTOR_CURRENT_FAIL 3 +#define MOTOR_VOLTAGE_FAIL 4 + +const u8 motor_lookup[80] = +{ 1,12,23,34,46,57,68,79, + 11,22,33,44,56,67,78,89, + 21,32,43,54,66,77,88,99, + 31,42,53,64,76,87,98, + 9,41,52,63,74,86,97, + 8,19,51,62,73,84,96, + 7,18,29,61,72,83,94, + 6,17,28,39,71,82,93, + 4,16,27,38,49,81,92, + 3,14,26,37,48,59,91, + 2,13,24,36,47,58,69, +}; + bool is_motor(u8 slot); u8 dispense_motor(u8 slot); -bool scan_motors(); #endif /* _MOTORS_H_ */