Please help - I would like to pass to the routine MUX(Input, Phase) where Input is 0,1 and Phase 0,1,2 depending if the user presses the key (V,I) and (R,W,B) on the serial terminal.
I can not get my enum statement to do this, and don't want to resort to a switch statement as this does not seem a very elegant work around. I'm sure there is a better way?
#include <ctype.h>
#include <uart.h>
char ch;
enum {I, V} char Input;
enum {R, W, B} char Phase;
ch = getch();
printf("*** MUX setup mode: ***\nEnter input as 'V' or 'I'\n");
Input = toupper(getch());
if ((Input = 'I') || (Input = 'V')) // First get input
{
printf("Enter input as 'R', 'W' or 'B'\n");
Phase = toupper(getch()); // next get phase
if ((Phase = 'R') || (Phase = 'W') || (Phase = 'B'))
MUX(Input, Phase);
}
Thanks.