Skip to content

Commit

Permalink
Add help and check for serial port
Browse files Browse the repository at this point in the history
  • Loading branch information
alvieboy committed Oct 30, 2009
1 parent bea1799 commit 43812f1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion UI/display.c
Expand Up @@ -121,12 +121,25 @@ gboolean vref_changed(GtkWidget *widget)
return TRUE;
}

int help(char*cmd)
{
printf("Usage: %s serialport\n\n",cmd);
printf(" example: %s /dev/ttyUSB0\n\n",cmd);
return -1;
}

int main(int argc,char **argv)
{
GtkWidget*scale_zoom;
gtk_init(&argc,&argv);
unsigned char data[512];
serial_init(argv[1]);

if (argc<2)
return help(argv[0]);

if (serial_init(argv[1])<0)
return -1;

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);


Expand Down

0 comments on commit 43812f1

Please sign in to comment.