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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [board/] [gpsdump.c] - Diff between revs 49 and 52

Show entire file | Details | Blame | View Log

Rev 49 Rev 52
Line 33... Line 33...
//
//
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
//
//
 
#include "artyboard.h"
#include "zipcpu.h"
#include "zipcpu.h"
#include "zipsys.h"
#include "zipsys.h"
#include "artyboard.h"
 
 
#define sys     _sys
 
 
void main(int argc, char **argv) {
void main(int argc, char **argv) {
        /*
        /*
        // Method one: direct polling
        // Method one: direct polling
        while(1) {
        while(1) {
Line 49... Line 51...
                        sys->io_uart_tx = ch;
                        sys->io_uart_tx = ch;
        }
        }
        */
        */
 
 
        // Method two: Waiting on interrupts
        // Method two: Waiting on interrupts
        zip->z_pic = SYSINT_GPSRX;
        int     lglen = (1<<((sys->io_gpsu.u_fifo >> 12)&0x0f))-1;
 
        zip->z_pic = SYSINT_GPSRXF;
        while(1) {
        while(1) {
                while((zip->z_pic & SYSINT_GPSRX)==0)
                while((zip->z_pic & SYSINT_GPSRXF)==0)
                        ;
                        ;
                sys->io_uart_tx = sys->io_gps_rx;
                for(int i=0; i<lglen/2; i++)
                zip->z_pic = SYSINT_GPSRX;
                        sys->io_uart.u_tx = sys->io_gpsu.u_rx & 0x0ff;
 
                zip->z_pic = SYSINT_GPSRXF;
        }
        }
 
 
        /*
        /*
        // Method three: Use the DMA
        // Method three: Use the DMA
        zip->z_dma.d_ctrl = DMACLEAR;
        zip->z_dma.d_ctrl = DMACLEAR;

powered by: WebSVN 2.1.0

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