Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison main.c @ 22:198ac9d95770
Add test for assert
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Sat, 17 Nov 2012 12:14:38 +1030 |
parents | bd8e2cf04034 |
children | 03592ca4d37e |
comparison
equal
deleted
inserted
replaced
21:bd8e2cf04034 | 22:198ac9d95770 |
---|---|
4 #include <stdint.h> | 4 #include <stdint.h> |
5 #include <time.h> | 5 #include <time.h> |
6 #include <string.h> | 6 #include <string.h> |
7 #include <sys/time.h> | 7 #include <sys/time.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <assert.h> | |
9 | 10 |
10 #include "stm32f10x.h" | 11 #include "stm32f10x.h" |
11 | 12 |
12 #include "1wire.h" | 13 #include "1wire.h" |
13 #include "comm.h" | 14 #include "comm.h" |
321 | 322 |
322 default: | 323 default: |
323 printf("%hd.%02hd\r\n", GETWHOLE(res), GETFRAC(res)); | 324 printf("%hd.%02hd\r\n", GETWHOLE(res), GETFRAC(res)); |
324 break; | 325 break; |
325 } | 326 } |
327 } else if (!strcmp("assert", argv[0])) { | |
328 assert(0 == 1); | |
326 } else if (!strcmp("zz", argv[0])) { | 329 } else if (!strcmp("zz", argv[0])) { |
327 NVIC_SystemReset(); | 330 NVIC_SystemReset(); |
328 } else { | 331 } else { |
329 printf("Unknown command\r\n"); | 332 printf("Unknown command\r\n"); |
330 } | 333 } |