Changeset 396c143 in multiio
- Timestamp:
- 10/05/11 18:03:32 (11 years ago)
- Branches:
- master
- Children:
- 03aa739
- Parents:
- 68a1abb
- Location:
- pcmmio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pcmmio/ChangeLog
r68a1abb r396c143 1 2011-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 1 5 2011-03-18 Joel Sherrill <joel.sherrill@oarcorp.com> 2 6 -
pcmmio/mio_io.c
r68a1abb r396c143 1353 1353 temp = read_dio_byte(port); 1354 1354 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 1355 1363 // Set the enable bit for our bit number 1356 1364 -
pcmmio/mio_io.h
r68a1abb r396c143 142 142 143 143 #endif 144 145 #include <sys/types.h>146 144 147 145 /* part of the porting layer */ … … 188 186 int dio_get_int(void); 189 187 int dio_get_int_with_timestamp( 190 struct timespec*timestamp188 unsigned long long *timestamp 191 189 ); 192 190 int wait_adc_int(int adc_num); … … 195 193 196 194 #if defined(__rtems__) 197 198 195 void pcmmio_initialize( 199 196 unsigned short _base_port, … … 206 203 int wait_dio_int_with_timeout(int milliseconds); 207 204 int wait_dio_int_with_timestamp( 208 int milliseconds,209 struct timespec*timestamp205 int milliseconds, 206 unsigned long long *timestamp 210 207 ); 211 208 int dio_get_missed_interrupts(void); -
pcmmio/mio_io_rtems.c
r68a1abb r396c143 32 32 /* Function prototypes for local functions */ 33 33 static int get_buffered_int( 34 struct timespec*timestamp34 unsigned long long *timestamp 35 35 ); 36 36 static void init_io(unsigned short io_address); … … 53 53 /////////////////////////////////////////////////////////////////////////////// 54 54 typedef struct { 55 struct timespectimestamp;56 int pin;55 unsigned long long timestamp; 56 int pin; 57 57 } din_message_t; 58 58 … … 340 340 341 341 int dio_get_int_with_timestamp( 342 struct timespec*timestamp342 unsigned long long *timestamp 343 343 ) 344 344 { … … 405 405 406 406 int wait_dio_int_with_timestamp( 407 int milliseconds,408 struct timespec*timestamp407 int milliseconds, 408 unsigned long long *timestamp 409 409 ) 410 410 { … … 426 426 ); 427 427 if ( rc == RTEMS_UNSATISFIED ) { 428 mio_error_code = MIO_TIMEOUT_ERROR; 429 return -1; 430 } 431 432 if ( rc == RTEMS_TIMEOUT ) { 428 433 mio_error_code = MIO_READ_DATA_FAILURE; 429 return -1;430 }431 432 if ( rc == RTEMS_TIMEOUT ) {433 mio_error_code = MIO_TIMEOUT_ERROR;434 434 return -1; 435 435 } … … 536 536 if ( rc == RTEMS_SUCCESSFUL ) 537 537 return 0; 538 539 mio_error_code = MIO_TIMEOUT_ERROR;540 538 return -1; 541 539 } … … 545 543 ) 546 544 { 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); 550 549 } 551 550 … … 651 650 } 652 651 652 #include <libcpu/cpuModel.h> /* for rdtsc */ 653 653 654 /* 654 655 * From this point down, we should be able to share easily with the Linux … … 702 703 703 704 /* DIO interrupt. Find out which bit */ 704 int_num = get_int(); 705 if (int_num) { 705 while ((int_num = get_int()) != 0) { 706 706 rtems_status_code rc; 707 707 din_message_t din; 708 708 709 rtems_clock_get_uptime( &din.timestamp );710 din.pin = int_num;709 din.timestamp = rdtsc(); 710 din.pin = int_num; 711 711 712 712 rc = rtems_message_queue_send( wq_dio, &din, sizeof(din_message_t) ); … … 859 859 860 860 int get_buffered_int( 861 struct timespec*timestamp861 unsigned long long *timestamp 862 862 ) 863 863 { … … 881 881 0 882 882 ); 883 if ( rc == RTEMS_UNSATISFIED ) { 884 mio_error_code = MIO_READ_DATA_FAILURE; 883 if ( rc == RTEMS_UNSATISFIED ) 885 884 return 0; 886 }887 885 888 886 if ( rc != RTEMS_SUCCESSFUL ) {
Note: See TracChangeset
for help on using the changeset viewer.