Revision 9b5281e9

View differences:

core/src/aos_system.c
543 543
  else {
544 544
    if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--hibernate") == 0) {
545 545
      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_HIBERNATE);
546
      chThdTerminate(currp);
546
      chThdTerminate(chThdGetSelfX());
547 547
      return AOS_OK;
548 548
    }
549 549
    else if (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "--deepsleep") == 0) {
550 550
      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_DEEPSLEEP);
551
      chThdTerminate(currp);
551
      chThdTerminate(chThdGetSelfX());
552 552
      return AOS_OK;
553 553
    }
554 554
    else if (strcmp(argv[1], "-t") == 0 || strcmp(argv[1], "--transportation") == 0) {
555 555
      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_TRANSPORTATION);
556
      chThdTerminate(currp);
556
      chThdTerminate(chThdGetSelfX());
557 557
      return AOS_OK;
558 558
    }
559 559
    else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--restart") == 0) {
560 560
      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_RESTART);
561
      chThdTerminate(currp);
561
      chThdTerminate(chThdGetSelfX());
562 562
      return AOS_OK;
563 563
    }
564 564
    else {

Also available in: Unified diff