text: /**
   * @file shell_port.c
   * @author Letter (NevermindZZT@gmail.com)
   * @brief 
   * @version 0.1
   * @date 2019-02-22
   * 
   * @copyright (c) 2019 Letter
   * 
   */
  
  #include "shell.h"
  #include "stdio.h"
  
  Shell shell;
  char shellBuffer[512];
  
  /**
   * @brief 用户shell写
   * 
   * @param data 数据
   */
  void userShellWrite(char data)
  {
      putchar(data);
  }
  
  /**
   * @brief 用户shell读
   * 
   * @param data 数据
   * @return char 状态
   */
  signed char userShellRead(char *data)
  {
      system("stty -echo");
      system("stty -icanon");
      *data = getchar();
      system("stty icanon");
      system("stty echo");
      return 0;
  }
  
  /**
   * @brief 用户shell初始化
   * 
   */
  void userShellInit(void)
  {
      shell.write = userShellWrite;
      shell.read = userShellRead;
      shellInit(&shell, shellBuffer, 512);
  }
  