OpenCores
URL https://opencores.org/ocsvn/xulalx25soc/xulalx25soc/trunk

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [sw/] [wbsettime.cpp] - Diff between revs 7 and 17

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 7 Rev 17
Line 44... Line 44...
#include <string.h>
#include <string.h>
#include <signal.h>
#include <signal.h>
#include <assert.h>
#include <assert.h>
#include <time.h>
#include <time.h>
 
 
#include "port.h"
 
#include "llcomms.h"
#include "llcomms.h"
 
#include "usbi.h"
 
#include "port.h"
#include "regdefs.h"
#include "regdefs.h"
 
 
DEVBUS  *m_fpga;
FPGA    *m_fpga;
void    closeup(int v) {
void    closeup(int v) {
        m_fpga->kill();
        m_fpga->kill();
        exit(0);
        exit(0);
}
}
 
 
int main(int argc, char **argv) {
int main(int argc, char **argv) {
        bool    set_time = true;
        bool    set_time = true;
 
        int     skp=0, port = FPGAPORT;
 
        bool    use_usb = true;
 
 
        FPGAOPEN(m_fpga);
        skp=1;
 
        for(int argn=0; argn<argc-skp; argn++) {
 
                if (argv[argn+skp][0] == '-') {
 
                        if (argv[argn+skp][1] == 'u')
 
                                use_usb = true;
 
                        else if (argv[argn+skp][1] == 'p') {
 
                                use_usb = false;
 
                                if (isdigit(argv[argn+skp][2]))
 
                                        port = atoi(&argv[argn+skp][2]);
 
                        }
 
                        skp++; argn--;
 
                } else
 
                        argv[argn] = argv[argn+skp];
 
        } argc -= skp;
 
 
 
        if (use_usb)
 
                m_fpga = new FPGA(new USBI());
 
        else
 
                m_fpga = new FPGA(new NETCOMMS(FPGAHOST, port));
 
 
        signal(SIGSTOP, closeup);
        signal(SIGSTOP, closeup);
        signal(SIGHUP, closeup);
        signal(SIGHUP, closeup);
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.