Ejemplo n.º 1
0
int main(int argc, char **argv)
{
    g_fd = open(argv[1], O_RDWR);
    if (errno == ENOENT && g_fd < 0)
    {
        int i;
        for (i = 0; i < 120; i++)
        {
            g_fd = open(argv[1], O_RDWR);
            if (g_fd >= 0)
                break;
            printf("."); fflush(stdout);
            usleep(500000);
        }
        printf("\n");
    }
    if (g_fd < 0)
        return bitch("open");

//    reset();
//    set_config(0);
//    set_config(1);

    usb_set_connected(0, 1);
    claim_if(0);

#if 0
    msd();
#else
    palm();
#endif
    return 0;
}
	void draw(){

		glPushMatrix();
		glRotatef(T,0,0,1);
		glTranslatef(0,a+l,0);

		//body with diaphram as center
		body(b,d,a,c);
			/********TEST**********/
			//the small dot at the center of the diaphram
			//cuboid(0.05,0.05,0.05);
			/**********TEST*******/

			//right hand
			glPushMatrix();
			//translate so that hands joint to body becomes origin
			glTranslatef(d,b,0);
			glRotatef(G1,-1,0,0);
			glRotatef(B1,0,0,1);
			//draw hand here starting from origin towards -ve y axis
			hand(h);

				glPushMatrix();
				glTranslatef(0,-h,0);
				glRotatef(D1,0,0,-1);
				//draw palm here from origin towards -ve y axis
				palm();
				glPopMatrix();
			glPopMatrix();

			//left hand
			glPushMatrix();
			//translate so that hands joint to body becomes origin
			glTranslatef(-d,b,0);
			glRotatef(G2,-1,0,0);
			glRotatef(B2,0,0,-1);
			//draw hand here starting from origin towards -ve y axis
			hand(h);

				glPushMatrix();
				glTranslatef(0,-h,0);
				glRotatef(D2,0,0,1);
				//draw palm here from origin towards -ve y axis
				palm();
				glPopMatrix();
			glPopMatrix();

			//right leg
			glPushMatrix();
			glTranslatef(c,-a,0);
			glRotatef(E1,-1,0,0);
			//draw leg starting from origin towards -ve y axis
			leg(l);

			glPopMatrix();

			//left leg
			glPushMatrix();
			glTranslatef(-c,-a,0);
			glRotatef(E2,-1,0,0);
			//draw leg starting from origin towards -ve y axis
			leg(l);

			glPopMatrix();

			//head
			glPushMatrix();
			glTranslatef(0,b,0);
			glRotatef(A,1,0,0);
			//draw head here starting from origin towards +ve y axis
			head();

			glPopMatrix();

		glPopMatrix();

		/*******TEST***********/
		//the thin vertical line running from top till 
		//bottom and the blue bottom plate
		//cuboid(1,0.1,1);
		//glColor3f(0.1,0.8,0.1);
		//cuboid(0.01,5,0.01);
		/*******TEST******/
	}