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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [deppi.cpp] - Diff between revs 45 and 52

Only display areas with differences | Details | Blame | View Log

Rev 45 Rev 52
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Filename:    deppi.cpp
// Filename:    deppi.cpp
//
//
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
//
//
// Purpose:     Creates a DEPP interface pseudo-character device, similar to
// Purpose:     Creates a DEPP interface pseudo-character device, similar to
//              what you might get from a serial port or other character device,
//              what you might get from a serial port or other character device,
//      from the DEPP interface to a CMOD S6 board.
//      from the DEPP interface to a CMOD S6 board.
//
//
// Creator:     Dan Gisselquist, Ph.D.
// Creator:     Dan Gisselquist, Ph.D.
//              Gisselquist Technology, LLC
//              Gisselquist Technology, LLC
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
//
//
// This program is free software (firmware): you can redistribute it and/or
// This program is free software (firmware): you can redistribute it and/or
// modify it under the terms of  the GNU General Public License as published
// modify it under the terms of  the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or (at
// by the Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
// your option) any later version.
//
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// You should have received a copy of the GNU General Public License along
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
// target there if the PDF file isn't present.)  If not, see
// target there if the PDF file isn't present.)  If not, see
// <http://www.gnu.org/licenses/> for a copy.
// <http://www.gnu.org/licenses/> for a copy.
//
//
// License:     GPL, v3, as defined and found on www.gnu.org,
// License:     GPL, v3, as defined and found on www.gnu.org,
//              http://www.gnu.org/licenses/gpl.html
//              http://www.gnu.org/licenses/gpl.html
//
//
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
//
//
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
#include <time.h>
#include <time.h>
// From Digilent's Adept Library
// From Digilent's Adept Library
#include "dpcdecl.h"
#include "dpcdecl.h"
#include "dmgr.h"
#include "dmgr.h"
#include "depp.h"
#include "depp.h"
 
 
// From my own library
// From my own library
#include "llcomms.h"
#include "llcomms.h"
#include "deppi.h"
#include "deppi.h"
 
 
FILE    *dbgfp = stderr;
FILE    *dbgfp = stderr;
 
 
DEPPI::DEPPI(const char *szSel) {
DEPPI::DEPPI(const char *szSel) {
        if ((!szSel)||(szSel[0] == '\0')) {
        if ((!szSel)||(szSel[0] == '\0')) {
                // Number of digilent devcies on a system
                // Number of digilent devcies on a system
                int     pcdvc;
                int     pcdvc;
 
 
                // Go fish and try to find the device
                // Go fish and try to find the device
                DmgrEnumDevices(&pcdvc);
                DmgrEnumDevices(&pcdvc);
 
 
                if (pcdvc < 0) {
                if (pcdvc < 0) {
                        depperr();
                        depperr();
                        exit(EXIT_FAILURE);
                        exit(EXIT_FAILURE);
                }
                }
 
 
                //
                //
                int     found = 0; // Number of devices found mtg our criteria
                int     found = 0; // Number of devices found mtg our criteria
                DVC     dvcinfo; // A structure to receive device info
                DVC     dvcinfo; // A structure to receive device info
                int     foundid=-1; // The id number of the device we found
                int     foundid=-1; // The id number of the device we found
 
 
                //
                //
                for(int devid=0; devid < pcdvc; devid++) {
                for(int devid=0; devid < pcdvc; devid++) {
                        DmgrGetDvc(devid, &dvcinfo);
                        DmgrGetDvc(devid, &dvcinfo);
                        // fprintf(dbgfp, "DEVICE NAME: %s\n", dvcinfo.szName);
                        // fprintf(dbgfp, "DEVICE NAME: %s\n", dvcinfo.szName);
                        if (strcmp(dvcinfo.szName, "CmodS6")==0) {
                        if (strcmp(dvcinfo.szName, "CmodS6")==0) {
                                found++;
                                found++;
                                // fprintf(dbgfp, "Found a CMOD!\n");
                                // fprintf(dbgfp, "Found a CMOD!\n");
                                foundid = devid;
                                foundid = devid;
                        }
                        }
                }
                }
 
 
                if (found == 0) {
                if (found == 0) {
                        fprintf(stderr, "No CModS6 devices found\n");
                        fprintf(stderr, "No CModS6 devices found\n");
                        exit(EXIT_FAILURE);
                        exit(EXIT_FAILURE);
                } else if (found > 1) {
                } else if (found > 1) {
                        fprintf(stderr, "More than one CModS6 device found.  Please consider opening your\n");
                        fprintf(stderr, "More than one CModS6 device found.  Please consider opening your\n");
                        fprintf(stderr, "device with a valid serial number instead.\n");
                        fprintf(stderr, "device with a valid serial number instead.\n");
                        exit(EXIT_FAILURE);
                        exit(EXIT_FAILURE);
                }
                }
 
 
                DmgrGetDvc(foundid, &dvcinfo);
                DmgrGetDvc(foundid, &dvcinfo);
                if (!DmgrOpen(&m_dev, dvcinfo.szConn)) {
                if (!DmgrOpen(&m_dev, dvcinfo.szConn)) {
                        fprintf(stderr, "Could not open device!\n");
                        fprintf(stderr, "Could not open device!\n");
                        depperr();
                        depperr();
                        exit(EXIT_FAILURE);
                        exit(EXIT_FAILURE);
                }
                }
 
 
                //
                //
                DmgrFreeDvcEnum();
                DmgrFreeDvcEnum();
        } else if (!DmgrOpen(&m_dev, (char *)szSel)) {
        } else if (!DmgrOpen(&m_dev, (char *)szSel)) {
                // We know the device serial number, so go open that particular
                // We know the device serial number, so go open that particular
                // device
                // device
                fprintf(stderr, "Named device open (DmgrOpen) failed!\n");
                fprintf(stderr, "Named device open (DmgrOpen) failed!\n");
                depperr();
                depperr();
                exit(EXIT_FAILURE);
                exit(EXIT_FAILURE);
        }
        }
 
 
        if (!DeppEnable(m_dev)) {
        if (!DeppEnable(m_dev)) {
                fprintf(stderr, "Could not enable DEPP interface to (opened) device\n");
                fprintf(stderr, "Could not enable DEPP interface to (opened) device\n");
 
 
                depperr();
                depperr();
                exit(EXIT_FAILURE);
                exit(EXIT_FAILURE);
        }
        }
 
 
        m_int = false, m_err = false;
        m_int = false, m_err = false;
 
 
        // fprintf(stdout, "Flushing **************\n");
        // fprintf(stdout, "Flushing **************\n");
        flush_read();
        flush_read();
        // fprintf(stdout, "Flushed! **************\n");
        // fprintf(stdout, "Flushed! **************\n");
}
}
 
 
DEPPI::~DEPPI(void) {
DEPPI::~DEPPI(void) {
        close();
        DEPPI::close();
}
}
 
 
void    DEPPI::close(void) {
void    DEPPI::close(void) {
        if (m_dev)
        if (m_dev)
                DmgrClose(m_dev);
                DmgrClose(m_dev);
        m_dev = 0;
        m_dev = 0;
 
        LLCOMMSI::close();
}
}
 
 
void    DEPPI::depperr(void) {
void    DEPPI::depperr(void) {
        ERC     erc = DmgrGetLastError();
        ERC     erc = DmgrGetLastError();
        if(erc != ercNoErc) {
        if(erc != ercNoErc) {
                char scode[cchErcMax], smsg[cchErcMsgMax];
                char scode[cchErcMax], smsg[cchErcMsgMax];
                DmgrSzFromErc(erc, scode, smsg);
                DmgrSzFromErc(erc, scode, smsg);
                fprintf(stderr, "ErrCode(%d): %s\n", erc, scode);
                fprintf(stderr, "ErrCode(%d): %s\n", erc, scode);
                fprintf(stderr, "ErrMessage: %s\n", smsg);
                fprintf(stderr, "ErrMessage: %s\n", smsg);
 
 
                if (erc == ercCapabilityConflict) {
                if (erc == ercCapabilityConflict) {
                        fprintf(stderr, "Do you have the hardware manager in Vivado open?\n");
                        fprintf(stderr, "Do you have the hardware manager in Vivado open?\n");
                        fprintf(stderr, "That could cause this conflict.\n");
                        fprintf(stderr, "That could cause this conflict.\n");
                }
                }
                close();
                close();
                exit(EXIT_FAILURE);
                exit(EXIT_FAILURE);
        }
        }
}
}
 
 
void    DEPPI::write(char *buf, int len) {
void    DEPPI::write(char *buf, int len) {
        bool    good = true;
        bool    good = true;
        const bool      dbg = false;
        const bool      dbg = false;
 
 
        if (dbg) {
        if (dbg) {
                // Debug code--write one at a time
                // Debug code--write one at a time
                fputs("WR: ", stdout);
                fputs("WR: ", stdout);
                for(int i=0; i<len; i++) {
                for(int i=0; i<len; i++) {
                        good = good && DeppPutReg(m_dev, 0, (unsigned char)buf[i], false);
                        good = good && DeppPutReg(m_dev, 0, (unsigned char)buf[i], false);
                        fputc(buf[i], stdout);
                        fputc(buf[i], stdout);
                } fputc('\n', stdout);
                } fputc('\n', stdout);
        } else
        } else
                good = DeppPutRegRepeat(m_dev, 0, (unsigned char *)buf, len, false);
                good = DeppPutRegRepeat(m_dev, 0, (unsigned char *)buf, len, false);
        if (!good)
        if (!good)
                depperr();
                depperr();
}
}
 
 
int     DEPPI::read(char *buf, int len) {
int     DEPPI::read(char *buf, int len) {
        return read(buf, len, 4);
        return read(buf, len, 4);
}
}
 
 
int     DEPPI::read(char *buf, int len, int timeout_ms) {
int     DEPPI::read(char *buf, int len, int timeout_ms) {
        int     left = len, nr=0;
        int     left = len, nr=0;
        struct  timespec        now, later;
        struct  timespec        now, later;
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
        clock_gettime(CLOCK_MONOTONIC, &now);
        clock_gettime(CLOCK_MONOTONIC, &now);
 
 
        if (dbg) fprintf(dbgfp, "USBI::read(%d) (FIFO is %d-%d)\n", len, m_rend, m_rbeg);
        if (dbg) fprintf(dbgfp, "USBI::read(%d) (FIFO is %d-%d)\n", len, m_rend, m_rbeg);
        nr = pop_fifo(buf, left);
        nr = pop_fifo(buf, left);
        left -= nr;
        left -= nr;
 
 
        while(left > 0) {
        while(left > 0) {
                raw_read(left, timeout_ms);
                raw_read(left, timeout_ms);
                nr = pop_fifo(&buf[len-left], left);
                nr = pop_fifo(&buf[len-left], left);
                left -= nr;
                left -= nr;
 
 
                if (dbg) fprintf(dbgfp, "\tWHILE (nr = %d, LEFT = %d, len=%d)\n", nr, left, len);
                if (dbg) fprintf(dbgfp, "\tWHILE (nr = %d, LEFT = %d, len=%d)\n", nr, left, len);
                if (nr == 0)
                if (nr == 0)
                        break;
                        break;
#define TIMEOUT
#define TIMEOUT
#ifdef  TIMEOUT
#ifdef  TIMEOUT
                if (timeout_ms == 0)
                if (timeout_ms == 0)
                        break;
                        break;
                else if (timeout_ms > 0) {
                else if (timeout_ms > 0) {
                        clock_gettime(CLOCK_MONOTONIC, &later);
                        clock_gettime(CLOCK_MONOTONIC, &later);
 
 
                        long    num_ns = later.tv_nsec - now.tv_nsec, num_ms;
                        long    num_ns = later.tv_nsec - now.tv_nsec, num_ms;
                        if (num_ns < 0) {
                        if (num_ns < 0) {
                                num_ns += 1000000000;
                                num_ns += 1000000000;
                                later.tv_sec--;
                                later.tv_sec--;
                        } num_ms = num_ns / 1000000;
                        } num_ms = num_ns / 1000000;
                        if (later.tv_sec > now.tv_sec)
                        if (later.tv_sec > now.tv_sec)
                                num_ms += (later.tv_sec - now.tv_sec)*1000;
                                num_ms += (later.tv_sec - now.tv_sec)*1000;
 
 
                        if (num_ms > timeout_ms)
                        if (num_ms > timeout_ms)
                                break;
                                break;
                }
                }
#endif
#endif
        }
        }
 
 
        if(dbg) fprintf(dbgfp, "READ %d characters (%d req, %d left)\n", len-left, len, left);
        if(dbg) fprintf(dbgfp, "READ %d characters (%d req, %d left)\n", len-left, len, left);
        return len-left;
        return len-left;
}
}
 
 
void    DEPPI::raw_read(const int clen, int timeout_ms) {
void    DEPPI::raw_read(const int clen, int timeout_ms) {
        int     empty = RCV_BUFMASK - ((m_rbeg - m_rend)&(RCV_BUFMASK));
        int     empty = RCV_BUFMASK - ((m_rbeg - m_rend)&(RCV_BUFMASK));
        int     len = clen;
        int     len = clen;
        bool    good = true;
        bool    good = true;
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
 
 
        if (dbg) fprintf(dbgfp, "DEPPI::raw_read(len=%d)\n", clen);
        if (dbg) fprintf(dbgfp, "DEPPI::raw_read(len=%d)\n", clen);
        if (len > empty)
        if (len > empty)
                len = empty;
                len = empty;
        if (len > 0) {
        if (len > 0) {
                // Fill the tail of our buffer
                // Fill the tail of our buffer
                int ln = len;
                int ln = len;
                if (ln > PKTLEN)
                if (ln > PKTLEN)
                        ln = PKTLEN;
                        ln = PKTLEN;
 
 
                // fprintf(stdout, "RAW-READ(%d)\n", ln);
                // fprintf(stdout, "RAW-READ(%d)\n", ln);
                if (false) {
                if (false) {
                        // Debug code--read one word at a time
                        // Debug code--read one word at a time
                        for(int i=0; i<ln; i++) {
                        for(int i=0; i<ln; i++) {
                                good = good && DeppGetReg(m_dev, 0, (unsigned char *)&m_rxbuf[i], false);
                                good = good && DeppGetReg(m_dev, 0, (unsigned char *)&m_rxbuf[i], false);
                                usleep(1);
                                usleep(1);
                        }
                        }
                } else
                } else
                        good = good && DeppGetRegRepeat(m_dev, 0, (unsigned char *)m_rxbuf, ln, false);
                        good = good && DeppGetRegRepeat(m_dev, 0, (unsigned char *)m_rxbuf, ln, false);
                if(dbg) fprintf(dbgfp, "DEPP: Pushing to FIFO\n");
                if(dbg) fprintf(dbgfp, "DEPP: Pushing to FIFO\n");
                push_fifo(m_rxbuf, ln);
                push_fifo(m_rxbuf, ln);
                len -= ln;
                len -= ln;
        }
        }
 
 
        if (!good)
        if (!good)
                depperr();
                depperr();
}
}
 
 
void    DEPPI::flush_read(void) {
void    DEPPI::flush_read(void) {
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
        if (dbg)        fprintf(dbgfp, "DEPPI::FLUSH-READ()\n");
        if (dbg)        fprintf(dbgfp, "DEPPI::FLUSH-READ()\n");
 
 
        do {
        do {
                m_rbeg = m_rend = 0;
                m_rbeg = m_rend = 0;
        } while(poll(4));
        } while(poll(4));
 
 
        if (dbg)        fprintf(dbgfp, "DEPPI::FLUSH-READ() -- COMPLETE\n");
        if (dbg)        fprintf(dbgfp, "DEPPI::FLUSH-READ() -- COMPLETE\n");
}
}
 
 
void    DEPPI::push_fifo(char *buf, int len) {
void    DEPPI::push_fifo(char *buf, int len) {
        char    last = 0;
        char    last = 0;
        char    *sptr = buf;
        char    *sptr = buf;
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
        if (dbg)  fprintf(dbgfp, "DEPP::PUSH(%d)\n", len);
        if (dbg)  fprintf(dbgfp, "DEPP::PUSH(%d)\n", len);
 
 
        if (m_rbeg != m_rend)
        if (m_rbeg != m_rend)
                last = m_rbuf[(m_rbeg-1)&RCV_BUFMASK];
                last = m_rbuf[(m_rbeg-1)&RCV_BUFMASK];
        if (dbg)        fprintf(dbgfp, "DEPPI::PUSH() last=%d, rbeg=%d, rend=%d\n", last, m_rbeg, m_rend);
        if (dbg)        fprintf(dbgfp, "DEPPI::PUSH() last=%d, rbeg=%d, rend=%d\n", last, m_rbeg, m_rend);
        for(int i=0; i<len; i++) {
        for(int i=0; i<len; i++) {
                char v = *sptr++;
                char v = *sptr++;
                if (((v & 0x80)||((unsigned char)v < 0x10))&&(v == last)) {
                if (((v & 0x80)||((unsigned char)v < 0x10))&&(v == last)) {
                        // Skipp any stuff bytes
                        // Skipp any stuff bytes
                        if (dbg)  fprintf(dbgfp, "SKIPPING-1: %02x\n", v & 0x0ff);
                        if (dbg)  fprintf(dbgfp, "SKIPPING-1: %02x\n", v & 0x0ff);
                } else if ((unsigned char)v == 0x0ff) {
                } else if ((unsigned char)v == 0x0ff) {
                        // Skipp any not-yet-ready bytes
                        // Skipp any not-yet-ready bytes
                        if (dbg)  fprintf(dbgfp, "SKIPPING-2: %02x\n", 0x0ff);
                        if (dbg)  fprintf(dbgfp, "SKIPPING-2: %02x\n", 0x0ff);
                } else {
                } else {
                        m_rbuf[m_rbeg] = v;
                        m_rbuf[m_rbeg] = v;
                        if (dbg) fprintf(dbgfp, "PUSHING: 0x%02x \'%c\'\n",
                        if (dbg) fprintf(dbgfp, "PUSHING: 0x%02x \'%c\'\n",
                                v&0x0ff, isprint(v)?v:'.');
                                v&0x0ff, isprint(v)?v:'.');
                        m_rbeg = (m_rbeg+1)&(RCV_BUFMASK);
                        m_rbeg = (m_rbeg+1)&(RCV_BUFMASK);
                } last = v;
                } last = v;
        }
        }
}
}
 
 
int     DEPPI::pop_fifo(char *buf, int len) {
int     DEPPI::pop_fifo(char *buf, int len) {
        int     avail = (m_rbeg - m_rend)&(RCV_BUFMASK);
        int     avail = (m_rbeg - m_rend)&(RCV_BUFMASK);
        int     left = len;
        int     left = len;
        int     nr = 0;
        int     nr = 0;
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
        if (dbg) fprintf(dbgfp, "Attempting to pop %d items from FIFO (%d - %d)\n",
        if (dbg) fprintf(dbgfp, "Attempting to pop %d items from FIFO (%d - %d)\n",
                        len, m_rend, m_rbeg);
                        len, m_rend, m_rbeg);
        while((avail > 0)&&(left > 0)) {
        while((avail > 0)&&(left > 0)) {
                int ln = RCV_BUFLEN-m_rend;
                int ln = RCV_BUFLEN-m_rend;
                if (ln > left)
                if (ln > left)
                        ln = left;
                        ln = left;
                if (ln > avail)
                if (ln > avail)
                        ln = avail;
                        ln = avail;
                memcpy(&buf[len-left], &m_rbuf[m_rend], ln);
                memcpy(&buf[len-left], &m_rbuf[m_rend], ln);
                left   -= ln;
                left   -= ln;
                avail  -= ln;
                avail  -= ln;
                m_rend  = (m_rend + ln)&(RCV_BUFMASK);
                m_rend  = (m_rend + ln)&(RCV_BUFMASK);
                nr     += ln;
                nr     += ln;
 
 
        }
        }
 
 
        return nr;
        return nr;
}
}
 
 
bool    DEPPI::poll(unsigned ms) {
bool    DEPPI::poll(unsigned ms) {
        int     avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
        int     avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
        bool    r = true;
        bool    r = true;
        const   bool    dbg = false;
        const   bool    dbg = false;
 
 
        if (dbg) fprintf(dbgfp, "POLL\n");
        if (dbg) fprintf(dbgfp, "POLL\n");
        if ((avail < 2)&&((avail<1)||(m_rbuf[m_rend]&0x80)||(m_rbuf[m_rend]<0x10))) {
        if ((avail < 2)&&((avail<1)||(m_rbuf[m_rend]&0x80)||(m_rbuf[m_rend]<0x10))) {
                if (dbg) fprintf(dbgfp, "POLL -- CALLS RAW READ\n");
                if (dbg) fprintf(dbgfp, "POLL -- CALLS RAW READ\n");
                raw_read(4,ms);
                raw_read(4,ms);
                avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
                avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
 
 
                if (avail != 0) {
                if (avail != 0) {
                        // Read 'til there's nothing more to be read
                        // Read 'til there's nothing more to be read
                        char    v = (m_rbuf[(m_rbeg-1)&(RCV_BUFMASK)]);
                        char    v = (m_rbuf[(m_rbeg-1)&(RCV_BUFMASK)]);
                        while(((v&0x80)==0)&&((unsigned)v>=0x10)&&(avail < RCV_BUFMASK-32)) {
                        while(((v&0x80)==0)&&((unsigned)v>=0x10)&&(avail < RCV_BUFMASK-32)) {
                                raw_read(26,ms);
                                raw_read(26,ms);
                                if (avail == ((m_rbeg-m_rend)&(RCV_BUFMASK)))
                                if (avail == ((m_rbeg-m_rend)&(RCV_BUFMASK)))
                                        break; // We didn't read anything more
                                        break; // We didn't read anything more
                                avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
                                avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
                                if (dbg) fprintf(dbgfp, "POLL/LOOP -- %d available\n", avail);
                                if (dbg) fprintf(dbgfp, "POLL/LOOP -- %d available\n", avail);
                        }
                        }
                        if (avail < 1)
                        if (avail < 1)
                                r = false;
                                r = false;
                        else if ((avail==1)&&((m_rbuf[m_rend]&0x80)||(m_rbuf[m_rend]<0x10)))
                        else if ((avail==1)&&((m_rbuf[m_rend]&0x80)||(m_rbuf[m_rend]<0x10)))
                                r = false;
                                r = false;
                } else r = false;
                } else r = false;
        }
        }
        if (dbg) fprintf(dbgfp, "POLL -- is %s\n", (r)?"true":"false");
        if (dbg) fprintf(dbgfp, "POLL -- is %s\n", (r)?"true":"false");
 
 
        return r;
        return r;
}
}
 
 

powered by: WebSVN 2.1.0

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