comparison packages/io/serial/current/tests/serial2.c @ 32:5af43b635655 ecos-sw-1999-08-18

Merge from eCos master repository on 1999-08-18-15:20:01-BST
author jlarmour
date Wed, 18 Aug 1999 15:33:44 +0000
parents 443894e2e912
children c38311975d4f
comparison
equal deleted inserted replaced
31:e8319549378c 32:5af43b635655
42 #include <cyg/infra/testcase.h> // test macros 42 #include <cyg/infra/testcase.h> // test macros
43 #include <cyg/infra/cyg_ass.h> // assertion macros 43 #include <cyg/infra/cyg_ass.h> // assertion macros
44 44
45 #if defined(CYGPKG_IO_SERIAL) && defined(CYGPKG_KERNEL) 45 #if defined(CYGPKG_IO_SERIAL) && defined(CYGPKG_KERNEL)
46 46
47 #ifdef CYGPKG_KERNEL
48 #include <pkgconf/kernel.h> 47 #include <pkgconf/kernel.h>
49 #ifdef CYGFUN_KERNEL_API_C 48
49 // Package option requirements
50 #if defined(CYGFUN_KERNEL_API_C)
51
50 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL 52 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL
51 #include <cyg/kernel/kapi.h> 53 #include <cyg/kernel/kapi.h>
52 unsigned char stack[CYGNUM_HAL_STACK_SIZE_TYPICAL]; 54 unsigned char stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
53 cyg_thread thread_data; 55 cyg_thread thread_data;
54 cyg_handle_t thread_handle; 56 cyg_handle_t thread_handle;
55 #endif
56 #endif
57 57
58 #include "ser_test_protocol.inl" 58 #include "ser_test_protocol.inl"
59 59
60 //--------------------------------------------------------------------------- 60 //---------------------------------------------------------------------------
61 // Serial test main function. 61 // Serial test main function.
82 82
83 void 83 void
84 cyg_start(void) 84 cyg_start(void)
85 { 85 {
86 CYG_TEST_INIT(); 86 CYG_TEST_INIT();
87 #ifdef CYGFUN_KERNEL_API_C
88 cyg_thread_create(10, // Priority - just a number 87 cyg_thread_create(10, // Priority - just a number
89 (cyg_thread_entry_t*)serial_test, // entry 88 (cyg_thread_entry_t*)serial_test, // entry
90 0, // 89 0, //
91 "serial_thread", // Name 90 "serial_thread", // Name
92 &stack[0], // Stack 91 &stack[0], // Stack
94 &thread_handle, // Handle 93 &thread_handle, // Handle
95 &thread_data // Thread data structure 94 &thread_data // Thread data structure
96 ); 95 );
97 cyg_thread_resume(thread_handle); 96 cyg_thread_resume(thread_handle);
98 cyg_scheduler_start(); 97 cyg_scheduler_start();
99 #else
100 serial_test();
101 #endif
102 } 98 }
103 99
104 #else // ifdef CYGPKG_IO_SERIAL 100 #else // CYGFUN_KERNEL_API_C
101 #define N_A_MSG "Needs kernel C API"
102 #endif
105 103
104 #else // CYGPKG_IO_SERIAL && CYGPKG_KERNEL
105 #define N_A_MSG "Needs IO/serial and Kernel"
106 #endif
107
108 #ifdef N_A_MSG
106 void 109 void
107 cyg_start(void) 110 cyg_start( void )
108 { 111 {
109 CYG_TEST_INIT(); 112 CYG_TEST_INIT();
110 CYG_TEST_NA("Requires serial device driver and kernel"); 113 CYG_TEST_NA( N_A_MSG);
111 } 114 }
115 #endif // N_A_MSG
112 116
113 #endif
114 // EOF serial2.c 117 // EOF serial2.c