Changeset 32eca41 in multiio


Ignore:
Timestamp:
Jun 8, 2009, 6:21:56 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
352ac8d
Parents:
2d65bbb
Message:

2009-06-08 Joel Sherrill <joel.sherrill@…>

  • Makefile, kbhit.c, mio_io.c, mio_io.h: First successful compilation under RTEMS. Added some Linux ifdef's.
  • rtems_config.c: New file.
Location:
pcmmio/original
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/original/ChangeLog

    r2d65bbb r32eca41  
     12009-06-08      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile, kbhit.c, mio_io.c, mio_io.h: First successful compilation
     4        under RTEMS. Added some Linux ifdef's.
     5        * rtems_config.c: New file.
     6
    172009-06-08      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • pcmmio/original/Makefile

    r2d65bbb r32eca41  
    1 # $Header$
    21#
    3 # $Id$
    4 #
    5 # $Log$
     2#  $Id$
    63#
    74
    8 MAJOR = 115
     5RTEMS_MAKEFILE_PATH=/home/joel/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/
     6#
     7#  RTEMS_MAKEFILE_PATH is typically set in an environment variable
     8#
    99
    10 CFLAGS += -DMAJOR_NUM=$(MAJOR)
     10MAINS= buffered.c # dacbuff.c dacout.c flash.c getall.c getvolt.c poll.c repeat.c
    1111
    12 # Test Makefile
     12PGMS=$(MAINS:%.c=${ARCH}/%.exe)
    1313
    14 ifneq ($(KERNELRELEASE),)
    15         obj-m := pcmmio.o
    16 else
    17         KERNELDIR ?= /lib/modules/$(shell uname -r)/build
    18         PWD := $(shell pwd)
     14# optional managers required
     15MANAGERS=all
    1916
    20 default:
    21         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
    22 endif
     17# C source names
     18SHARED_CSRCS = rtems_config.c mio_io.c kbhit.c
     19SHARED_COBJS = $(SHARED_CSRCS:%.c=${ARCH}/%.o)
    2320
    24 mio_io.o: mio_io.c mio_io.h Makefile
    25         gcc -c $(CFLAGS) mio_io.c
     21include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
     22include $(RTEMS_CUSTOM)
     23include $(PROJECT_ROOT)/make/leaf.cfg
    2624
    27 nodes:
    28         mknod pcmmio c $(MAJOR) 0
    29         chmod a+rw pcmmio
     25OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
    3026
    31 all:    default nodes poll flash getvolt dacout getall repeat buffered dacbuff
     27all:    ${ARCH} $(SHARED_COBJS) $(PGMS)
    3228
    33 dacbuff: dacbuff.c mio_io.o mio_io.h Makefile kbhit.c
    34         gcc $(CFLAGS) -static dacbuff.c kbhit.c mio_io.o -o dacbuff
    35         chmod a+x dacbuff
    36        
    37 buffered: buffered.c mio_io.o mio_io.h Makefile kbhit.c
    38         gcc $(CFLAGS) -static buffered.c kbhit.c mio_io.o -o buffered
    39         chmod a+x buffered
    40        
    41 repeat: repeat.c mio_io.o mio_io.h Makefile kbhit.c
    42         gcc $(CFLAGS) -D_REENTRANT -static repeat.c kbhit.c mio_io.o -o repeat -lpthread
    43         chmod a+x repeat
    44 
    45 flash: flash.c mio_io.h kbhit.c mio_io.o Makefile
    46         gcc $(CFLAGS) -static flash.c kbhit.c mio_io.o -o flash
    47         chmod a+x flash
    48 
    49 getvolt: getvolt.c mio_io.h mio_io.o Makefile
    50         gcc $(CFLAGS) -static getvolt.c mio_io.o -o getvolt
    51         chmod a+x getvolt
    52 
    53 getall: getall.c mio_io.h mio_io.o Makefile
    54         gcc $(CFLAGS) -static getall.c mio_io.o -o getall
    55         chmod a+x getall
    56 
    57 dacout: dacout.c mio_io.h mio_io.o Makefile
    58         gcc $(CFLAGS) -static dacout.c mio_io.o -o dacout
    59         chmod a+x dacout
    60 
    61 poll:  poll.c mio_io.o mio_io.h Makefile
    62         gcc $(CFLAGS) -D_REENTRANT -static poll.c mio_io.o -o poll -lpthread
    63         chmod a+x poll
    64  
    65 clean:
    66         rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions pcmmio
    67 
    68 
     29${ARCH}/%.exe: %.c
     30        $(CC) -o $@ $< $(SHARED_COBJS)
  • pcmmio/original/kbhit.c

    r2d65bbb r32eca41  
    77*
    88*   $Log$
     9*   Revision 1.1.1.1  2009/06/08 14:52:43  joel
     10*   Initial import.
     11*
    912*   Revision 1.1  2005/04/19 20:39:11  steve
    1013*   Initial revision
     
    2427#include <stdio.h>
    2528#include <termios.h>
     29#if defined(__linux__)
    2630#include <term.h>
    2731#include <curses.h>
     32#endif
    2833#include <unistd.h>
    2934
  • pcmmio/original/mio_io.c

    r2d65bbb r32eca41  
    66*
    77*  $Log$
     8*  Revision 1.1.1.1  2009/06/08 14:52:43  joel
     9*  Initial import.
     10*
    811*
    912*  This file implements all of the supported 'C' language functions. Where necessary
     
    98101        mio_error_code = MIO_SUCCESS;
    99102
    100     if(check_handle())   /* Check for chip available */
     103        if(check_handle())   /* Check for chip available */
    101104                return -1;
    102105
  • pcmmio/original/mio_io.h

    r2d65bbb r32eca41  
    88
    99/* $Log$
    10 *
    11 */
     10 * Revision 1.1.1.1  2009/06/08 14:52:43  joel
     11 * Initial import.
     12 */
    1213
    1314#ifndef CHARDEV_H
    1415#define CHARDEV_H
    1516
     17#if defined(__linux__)
    1618#include <linux/ioctl.h>
     19#else
     20#define MAJOR_NUM 1
     21#define _IOWR(_x, _y, _t) (_t) ((_x << 16) | (_y << 16))
     22#endif
    1723
    1824
     
    187193int wait_dio_int(void);
    188194
    189 
    190 
    191 
    192 
    193 
    194 
    195 
    196 
    197 
    198 
    199 
    200 
    201 
    202 
    203 
    204 
    205 
    206 
    207 
    208 
    209 
    210 
    211 
    212 
    213 
    214 
    215 
    216 
    217 
    218 
    219 
    220 
    221 
    222 
    223 
    224 
    225 
    226 
    227 
    228 
    229 
Note: See TracChangeset for help on using the changeset viewer.