打印

给Uboot添加一个设置LCD尺寸的命令setlcdfollowing,Sourceandroid

[复制链接]
265|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
  

  Step 1: Open uboot source code file /common/command.c

  Step 2: Add the following code:

  int

  do_setlcd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])

  {

  int i = 0;

  char *pch = NULL;

  char bootargstr[300];

  bool isValidArg = true;

  if((strcmp(argv[1],35) != 0)

  (strcmp(argv[1],43) != 0)

  (strcmp(argv[1],56) != 0)

  (strcmp(argv[1],70) != 0)

  (strcmp(argv[1],VGA800) != 0)

  (strcmp(argv[1],VGA1024) != 0) )

  {

  isValidArg = false;

  }

  if (!isValidArg)

  {

  printf(*** Invalid command %s \n, argv[1]);

  printf(Valid command must be one of the following: \n);

  printf(setlcd 35\n);

  printf(setlcd 43\n);

  printf(setlcd 56\n);

  printf(setlcd 70\n);

  printf(setlcd VGA800\n);

  printf(setlcd VGA1024\n);

  return -1;

  }

  strcpy(bootargstr, getenv(bootargs));

  /* remove previous setting */

  pch = strstr (bootargstr, lcdsize);

  if(pch != NULL)

  {

  for(i = pch-bootargstr; i300; i++)

  {

  bootargstr<i>

  = '\0';

  }

  }

  strcat(bootargstr,  lcdsize=);

  strcat(bootargstr, argv[1]);

  setenv(bootargs, bootargstr);

  printf(set string:%s\n, bootargstr);

  saveenv();

  return 0;

  }

  U_BOOT_CMD(</i>

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

432

主题

439

帖子

0

粉丝