Esempio n. 1
0
static int 
mars_routine (Info *info, GPPort *port, char param, int n) 
{
	char c[16];
	char start[2] = {0x19, 0x51};
	char do_something[2]; 
	char address1[2];
	char address2[2];
	char address3[2];
	char address4[2];
	char address5[2];
	char address6[2];

	do_something[0]= 0x19; 
	do_something[1]=param;

	/* See protocol.txt for my theories about what these mean. */
	address1[0] = 0x19;
	address1[1] = info[8*n+1];
	address2[0] = 0x19;
	address2[1] = info[8*n+2];
	address3[0] = 0x19;
	address3[1] = info[8*n+3];
	address4[0] = 0x19;
	address4[1] = info[8*n+4];
	address5[0] = 0x19;
	address5[1] = info[8*n+5];
	address6[0] = 0x19;
	address6[1] = info[8*n+6];


	memset(c,0,sizeof(c));

	/*Routine used in initialization, photo download, and reset. */
    	m_read(port, c, 16); 	
	m_command(port, start, 2, c);
	m_command(port, do_something, 2, c);
	m_command(port, address1, 2, c);

	c[0] = 0;
	gp_port_write(port, address2, 2);	
	/* Moving the memory cursor to the given address? */
	while (( c[0] != 0xa) ) {	
    	m_read(port, c, 16); 	
	}
	
	m_command(port, address3, 2, c);
	m_command(port, address4, 2, c);
	m_command(port, address5, 2, c);
	m_command(port, address6, 2, c);
	gp_port_write(port, "\x19", 1);
	gp_port_read(port, c , 16);
	/* Next thing is to switch the inep. Some cameras need a pause here */
	usleep (MARS_SLEEP); 

	return(c[0]);
}
Esempio n. 2
0
	inline void run_command(ConsoleArguments *args)
	{
		m_command(args);
	}
///---------------------------------------------------------------------------------
///
///---------------------------------------------------------------------------------
void DeveloperConsoleCommand::RunCommand( DeveloperConsoleArguments *args )
{
    m_command( args );
}