|
| 1 | +# Test the optimized versions of pinMode |
| 2 | + |
| 3 | +After each test the content of the GPIO registers is checked against |
| 4 | +the expected values. The table results[] contains the number of mismatched |
| 5 | +bytes after each test. |
| 6 | + |
| 7 | +Expected result: all bytes in results[] == 0x00 |
| 8 | + |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +The compiled functions are executed in the simulator: |
| 13 | + |
| 14 | + $ make sim |
| 15 | + uCsim 0.6-pre54, Copyright (C) 1997 Daniel Drotos. |
| 16 | + uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
| 17 | + This is free software, and you are welcome to redistribute it |
| 18 | + under certain conditions; type `show c' for details. |
| 19 | + Loading from pinmode.ihx |
| 20 | + 920 words read from pinmode.ihx |
| 21 | + fill ram_chip 0 1023 0 |
| 22 | + fill io_chip 0 44 0 |
| 23 | + s 10000 |
| 24 | + du io_chip 0 4 |
| 25 | + du io_chip 5 9 |
| 26 | + du io_chip 10 14 |
| 27 | + du io_chip 15 19 |
| 28 | + du ram_chip 1 6 |
| 29 | + du ram_chip 0x0100 |
| 30 | + quit |
| 31 | + Stop at 0x00838a: (109) |
| 32 | + V-IHINZC Flags= 0x22 34 " A= 0x00 0 . |
| 33 | + 0-100010 X= 0x0006 6 . Y= 0x5013 20499 . |
| 34 | + SP= 0x17fd [SP+1]= 00 0 . |
| 35 | + ? 0x0838a 20 fe jra 0x838a |
| 36 | + F 0x00838a |
| 37 | + Simulated 19210 ticks in 0.003475 sec, rate=0.690970 |
| 38 | + 0x000 00 00 00 00 00 ..... |
| 39 | + 0x005 00 00 20 20 00 .. . |
| 40 | + 0x00a 00 00 20 10 00 .. .. |
| 41 | + 0x00f 00 00 42 02 42 ..B.B |
| 42 | + 0x0001 00 00 00 00 00 00 ...... |
| 43 | + 0x0100 00 00 00 00 00 00 00 00 ........ |
| 44 | + 0x0108 00 00 00 00 00 00 00 00 ........ |
| 45 | + 0x0110 00 00 00 00 00 00 00 00 ........ |
| 46 | + 0x0118 00 00 00 00 00 00 00 00 ........ |
| 47 | + 0x0120 00 00 00 00 00 00 00 00 ........ |
| 48 | + 0x0128 00 00 00 00 00 00 00 00 ........ |
| 49 | + 0x0130 00 00 00 00 00 00 00 00 ........ |
| 50 | + 0x0138 00 00 00 00 00 00 00 00 ........ |
| 51 | + 0x0140 00 00 00 00 00 00 00 00 ........ |
| 52 | + 0x0148 00 00 00 00 00 00 00 00 ........ |
| 53 | + $ |
| 54 | + |
| 55 | + |
| 56 | +## Meaning of the output |
| 57 | + |
| 58 | +The first block of data is the content of the GPIO registers: |
| 59 | + |
| 60 | + 0x000 00 00 00 00 00 ..... |
| 61 | + 0x005 00 00 20 20 00 .. . |
| 62 | + 0x00a 00 00 20 10 00 .. .. |
| 63 | + 0x00f 00 00 42 02 42 ..B.B |
| 64 | + |
| 65 | +The next line contains the result bytes, one for each test step. Zero means |
| 66 | +no differences to the expected result: |
| 67 | + |
| 68 | + 0x0001 00 00 00 00 00 00 ...... |
| 69 | + |
| 70 | +The last block is a simple memory dump. It might contain additional |
| 71 | +information (but not used here and always zero): |
| 72 | + |
| 73 | + 0x0100 00 00 00 00 00 00 00 00 ........ |
| 74 | + 0x0108 00 00 00 00 00 00 00 00 ........ |
| 75 | + 0x0110 00 00 00 00 00 00 00 00 ........ |
| 76 | + 0x0118 00 00 00 00 00 00 00 00 ........ |
| 77 | + 0x0120 00 00 00 00 00 00 00 00 ........ |
| 78 | + 0x0128 00 00 00 00 00 00 00 00 ........ |
| 79 | + 0x0130 00 00 00 00 00 00 00 00 ........ |
| 80 | + 0x0138 00 00 00 00 00 00 00 00 ........ |
| 81 | + 0x0140 00 00 00 00 00 00 00 00 ........ |
| 82 | + 0x0148 00 00 00 00 00 00 00 00 ........ |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +## Results |
| 88 | + |
1 | 89 | original version (276 bytes) |
2 | 90 | 0080A0 47 _pinMode1: |
3 | 91 | 0081B4 268 _setup: |
|
0 commit comments