Changeset 364 for asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/ntshell/src/ntshell_main.c
r342 r364 60 60 #include "socket_stub.h" 61 61 #include "usb_hbth.h" 62 #include "mbed_api.h" 62 63 63 64 extern int bt_bnep_mode; … … 69 70 const struct utsname host_name = { 70 71 "TOPPERS/ASP3", 71 72 73 74 75 72 TARGET_NAME, 73 "3.2.0", 74 "3.2.0", 75 TARGET_NAME, 76 "toppers.jp" 76 77 }; 77 78 … … 88 89 jmp_buf process_exit; 89 90 void sys_init(void); 90 91 void ntshell_task_init() 92 { 91 NTSHELL_SERIAL_READ ntshell_serial_read = 0; 92 NTSHELL_SERIAL_WRITE ntshell_serial_write = 0; 93 void *ntshell_serial_extobj; 94 95 unsigned char ntstdio_xi(struct ntstdio_t *handle) 96 { 97 unsigned char buf[1]; 98 ntshell_serial_read((char *)buf, 1, ntshell_serial_extobj); 99 return buf[0]; 100 } 101 102 void ntstdio_xo(struct ntstdio_t *handle, unsigned char c) 103 { 104 char buf[1]; 105 buf[0] = c; 106 ntshell_serial_write(buf, 1, ntshell_serial_extobj); 107 } 108 109 void ntshell_task_init(NTSHELL_SERIAL_READ func_read, 110 NTSHELL_SERIAL_WRITE func_write, void *extobj) 111 { 112 ntshell_serial_read = func_read; 113 ntshell_serial_write = func_write; 114 ntshell_serial_extobj = extobj; 115 93 116 sys_init(); 94 117 … … 126 149 int result = 0; 127 150 int found = 0; 151 152 if (*args == 0) 153 return result; 128 154 129 155 if (strcmp((const char *)args[1], "help") == 0) { … … 295 321 int shell_clock_getres(clockid_t clk_id, struct timespec *res) 296 322 { 297 if ( clk_id != CLOCK_REALTIME)323 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 298 324 return -EINVAL; 299 325 … … 308 334 SYSTIM now = 0; 309 335 310 if ( clk_id != CLOCK_REALTIME)336 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 311 337 return -EINVAL; 312 338 … … 320 346 int shell_clock_settime(clockid_t clk_id, const struct timespec *tp) 321 347 { 322 if ( clk_id != CLOCK_REALTIME)348 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 323 349 return -EINVAL; 324 350 325 rtc_write(tp->tv_sec); 351 SYSTIM time; 352 ER ret; 353 354 time = (tp->tv_sec * 1000000ll) + (tp->tv_nsec / 1000ll); 355 356 ret = set_tim(time); 357 if (ret != E_OK) { 358 return -EPERM; 359 } 326 360 327 361 return 0; … … 356 390 } 357 391 358 struct sigaction sigtable[ 6];392 struct sigaction sigtable[7]; 359 393 360 394 int shell_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old) … … 381 415 sat = &sigtable[5]; 382 416 break; 417 case SIGPIPE: 418 sat = &sigtable[6]; 419 break; 383 420 default: 384 421 return -EINVAL;
Note:
See TracChangeset
for help on using the changeset viewer.