/* Safety-Critical Systems 4: Engineering of Embedded Software Systems WiSe 2002/03 bicycle odometer: interface software - operating system and hardware Jan Bredereke */ /* application functions called by the operating system */ void rtinit(void); /* called once at power-up; before rtmain() */ void rtmain(void); /* called exactly every 1 ms */ /* number of output display digits */ #define DIGIT_NUM 5 /* input and output variables, as described in the documentation */ unsigned char inByte; /* sensor and button input bits */ unsigned char modeOut; /* mode indicator output bits */ unsigned char numberOut[DIGIT_NUM]; /* number display digits */ /* Bit masks for the input variables: */ #define INBYTE_SENSOR ((unsigned char) 1) #define INBYTE_BUTTON ((unsigned char) 2) #define MODE_IND_KMH ((unsigned char) 1) #define MODE_IND_KMTOTAL ((unsigned char) 2) #define MODE_IND_KMTRIP ((unsigned char) 4) /* value for blank digit */ #define D_BLANK ((unsigned char) 15)