Mercurial > ~darius > hgwebdir.cgi > stm32temp
changeset 44:f1cc171b06b5
Remove useless delay test. Add GPIO PE2 changes to make testing arbitary delays possible.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Tue, 02 Apr 2013 10:54:20 +1030 |
parents | b4440f9f6d47 |
children | 6466e8720e04 |
files | main.c |
diffstat | 1 files changed, 11 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Mon Apr 01 23:38:34 2013 +1030 +++ b/main.c Tue Apr 02 10:54:20 2013 +1030 @@ -208,10 +208,6 @@ tempctrl_cmd(argc - 1, argv + 1); } else if (!strcmp("pwm", argv[0])) { lcd_setpwm(atoi(argv[1])); - } else if (!strcmp("timing", argv[0])) { - fputs("Timing..\r\n", stdout); - delay(10000); - fputs("Done\r\n", stdout); } else if (!strcmp("circ", argv[0])) { if (argc != 5) { fputs("Unable to parse circ args\r\n", stdout); @@ -249,19 +245,23 @@ lcd_line(x, y, x1, y1, c); } else if (!strcmp("delay", argv[0])) { - GPIO_InitTypeDef GPIO_InitStructure; - - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; - GPIO_Init(GPIOE, &GPIO_InitStructure); - for (x = 0; x < 100; x++) { GPIO_SetBits(GPIOE, GPIO_Pin_2); delay(30); GPIO_ResetBits(GPIOE, GPIO_Pin_2); delay(60); } + } else if (!strcmp("cyc", argv[0])) { + if (argc != 2) { + fputs("Incorrect number of arguments\r\n", stdout); + goto out; + } + + GPIO_SetBits(GPIOE, GPIO_Pin_2); + delay(atoi(argv[1])); + GPIO_ResetBits(GPIOE, GPIO_Pin_2); + + fputs("Done\r\n", stdout); } else if (!strcmp("rs", argv[0])) { printf("Reset got %d\r\n", OWTouchReset()); } else if (!strcmp("sr", argv[0])) { @@ -349,15 +349,6 @@ printf("Max err = %.3f\r\n", maxerr); } else if (!strcmp("assert", argv[0])) { assert(0 == 1); - } else if (!strcmp("cyc", argv[0])) { - if (argc != 2) { - fputs("Incorrect number of arguments\r\n", stdout); - goto out; - } - - delay(atoi(argv[1])); - - fputs("Done\r\n", stdout); } else if (!strcmp("zz", argv[0])) { NVIC_SystemReset(); } else {