Changeset 396c143 in multiio


Ignore:
Timestamp:
Oct 5, 2011, 6:03:32 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
03aa739
Parents:
68a1abb
Message:

2011-10-05 Cindy Cicalese <cicalese@…>

  • mio_io.c, mio_io.h, mio_io_rtems.c: Updates after testing in lab.
Location:
pcmmio
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/ChangeLog

    r68a1abb r396c143  
     12011-10-05      Cindy Cicalese <cicalese@mitre.org>
     2
     3        * mio_io.c, mio_io.h, mio_io_rtems.c: Updates after testing in lab.
     4
    152011-03-18      Joel Sherrill <joel.sherrill@oarcorp.com>
    26
  • pcmmio/mio_io.c

    r68a1abb r396c143  
    13531353        temp = read_dio_byte(port);
    13541354
     1355        // Temporarily clear only our enable. This clears the interrupt
     1356
     1357        temp = temp & ~mask;
     1358
     1359        // Write out the temporary value
     1360
     1361        write_dio_byte(port, temp);
     1362
    13551363        // Set the enable bit for our bit number
    13561364
  • pcmmio/mio_io.h

    r68a1abb r396c143  
    142142
    143143#endif
    144 
    145 #include <sys/types.h>
    146144
    147145/* part of the porting layer */
     
    188186int dio_get_int(void);
    189187int dio_get_int_with_timestamp(
    190   struct timespec *timestamp
     188  unsigned long long *timestamp
    191189);
    192190int wait_adc_int(int adc_num);
     
    195193
    196194#if defined(__rtems__)
    197 
    198195  void pcmmio_initialize(
    199196    unsigned short _base_port,
     
    206203  int wait_dio_int_with_timeout(int milliseconds);
    207204  int wait_dio_int_with_timestamp(
    208     int              milliseconds,
    209     struct timespec *timestamp
     205    int                 milliseconds,
     206    unsigned long long *timestamp
    210207  );
    211208  int dio_get_missed_interrupts(void);
  • pcmmio/mio_io_rtems.c

    r68a1abb r396c143  
    3232/* Function prototypes for local functions */
    3333static int get_buffered_int(
    34   struct timespec *timestamp
     34  unsigned long long *timestamp
    3535);
    3636static void init_io(unsigned short io_address);
     
    5353///////////////////////////////////////////////////////////////////////////////
    5454typedef struct {
    55   struct timespec timestamp;
    56   int             pin;
     55  unsigned long long timestamp;
     56  int                pin;
    5757} din_message_t;
    5858
     
    340340
    341341int dio_get_int_with_timestamp(
    342   struct timespec *timestamp
     342  unsigned long long *timestamp
    343343)
    344344{
     
    405405
    406406int wait_dio_int_with_timestamp(
    407   int              milliseconds,
    408   struct timespec *timestamp
     407  int                 milliseconds,
     408  unsigned long long *timestamp
    409409)
    410410{
     
    426426  );
    427427  if ( rc == RTEMS_UNSATISFIED ) {
     428    mio_error_code = MIO_TIMEOUT_ERROR;
     429    return -1;
     430  }
     431
     432  if ( rc == RTEMS_TIMEOUT ) {
    428433    mio_error_code = MIO_READ_DATA_FAILURE;
    429     return -1;
    430   }
    431 
    432   if ( rc == RTEMS_TIMEOUT ) {
    433     mio_error_code = MIO_TIMEOUT_ERROR;
    434434    return -1;
    435435  }
     
    536536  if ( rc == RTEMS_SUCCESSFUL )
    537537    return 0;
    538 
    539   mio_error_code = MIO_TIMEOUT_ERROR;
    540538  return -1;
    541539}
     
    545543)
    546544{
    547   uint32_t  unblocked;
    548 
    549   (void) rtems_barrier_release(*id, &unblocked);
     545  rtems_status_code rc;
     546  uint32_t          unblocked;
     547
     548  rc = rtems_barrier_release(*id, &unblocked);
    550549}
    551550
     
    651650}
    652651
     652#include <libcpu/cpuModel.h> /* for rdtsc */
     653
    653654/*
    654655 *  From this point down, we should be able to share easily with the Linux
     
    702703
    703704    /* DIO interrupt. Find out which bit */
    704     int_num = get_int();
    705     if (int_num) {
     705    while ((int_num = get_int()) != 0) {
    706706      rtems_status_code  rc;
    707707      din_message_t      din;
    708708
    709       rtems_clock_get_uptime( &din.timestamp );
    710       din.pin = int_num;
     709      din.timestamp = rdtsc();
     710      din.pin       = int_num;
    711711
    712712      rc = rtems_message_queue_send( wq_dio, &din, sizeof(din_message_t) );
     
    859859
    860860int get_buffered_int(
    861   struct timespec *timestamp
     861  unsigned long long *timestamp
    862862)
    863863{
     
    881881    0
    882882  );
    883   if ( rc == RTEMS_UNSATISFIED ) {
    884     mio_error_code = MIO_READ_DATA_FAILURE;
     883  if ( rc == RTEMS_UNSATISFIED )
    885884    return 0;
    886   }
    887885
    888886  if ( rc != RTEMS_SUCCESSFUL ) {
Note: See TracChangeset for help on using the changeset viewer.