Toyomasa Watarai
/
test_big-size_program
Test program to generate big ROM size bin file
main.cpp@3:3eae9fc3effb, 2016-02-25 (annotated)
- Committer:
- MACRUM
- Date:
- Thu Feb 25 05:28:41 2016 +0000
- Revision:
- 3:3eae9fc3effb
- Parent:
- 2:4262f7e2aa9e
Add some more targets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MACRUM | 0:d7492cf9dab6 | 1 | #include "mbed.h" |
MACRUM | 0:d7492cf9dab6 | 2 | |
MACRUM | 0:d7492cf9dab6 | 3 | DigitalOut myled(LED1); |
MACRUM | 0:d7492cf9dab6 | 4 | Serial pc(USBTX, USBRX); |
MACRUM | 0:d7492cf9dab6 | 5 | |
MACRUM | 1:d1898c185d3c | 6 | #pragma no_inline |
MACRUM | 1:d1898c185d3c | 7 | |
MACRUM | 3:3eae9fc3effb | 8 | #if defined(TARGET_LPC1114) || defined(TARGET_SSCI824) |
MACRUM | 3:3eae9fc3effb | 9 | int foo1(int x) __attribute__((section(".ARM.__at_0x00000FF8"))); |
MACRUM | 3:3eae9fc3effb | 10 | int foo2(int x) __attribute__((section(".ARM.__at_0x00004004"))); |
MACRUM | 3:3eae9fc3effb | 11 | int foo3(int x) __attribute__((section(".ARM.__at_0x00007800"))); |
MACRUM | 3:3eae9fc3effb | 12 | #elif defined(TARGET_HRM1017) || defined(TARGET_TY51822R3) |
MACRUM | 3:3eae9fc3effb | 13 | int foo1(int x) __attribute__((section(".ARM.__at_0x0001C200"))); |
MACRUM | 3:3eae9fc3effb | 14 | int foo2(int x) __attribute__((section(".ARM.__at_0x00020000"))); |
MACRUM | 3:3eae9fc3effb | 15 | int foo3(int x) __attribute__((section(".ARM.__at_0x00023F00"))); |
MACRUM | 3:3eae9fc3effb | 16 | #elif defined(TARGET_LPC4337) |
MACRUM | 1:d1898c185d3c | 17 | int foo1(int x) __attribute__((section(".ARM.__at_0x1A010000"))); |
MACRUM | 1:d1898c185d3c | 18 | int foo2(int x) __attribute__((section(".ARM.__at_0x1A020000"))); |
MACRUM | 1:d1898c185d3c | 19 | int foo3(int x) __attribute__((section(".ARM.__at_0x1A012000"))); |
MACRUM | 2:4262f7e2aa9e | 20 | #elif defined(TARGET_LPC11U68) |
MACRUM | 2:4262f7e2aa9e | 21 | int foo1(int x) __attribute__((section(".ARM.__at_0x00018000"))); |
MACRUM | 2:4262f7e2aa9e | 22 | int foo2(int x) __attribute__((section(".ARM.__at_0x00020000"))); |
MACRUM | 2:4262f7e2aa9e | 23 | int foo3(int x) __attribute__((section(".ARM.__at_0x00011000"))); |
MACRUM | 2:4262f7e2aa9e | 24 | #elif defined(TARGET_LPC1549) |
MACRUM | 2:4262f7e2aa9e | 25 | int foo1(int x) __attribute__((section(".ARM.__at_0x00020000"))); |
MACRUM | 2:4262f7e2aa9e | 26 | int foo2(int x) __attribute__((section(".ARM.__at_0x00030000"))); |
MACRUM | 2:4262f7e2aa9e | 27 | int foo3(int x) __attribute__((section(".ARM.__at_0x0003B000"))); |
MACRUM | 3:3eae9fc3effb | 28 | #elif defined(TARGET_RZ_A1H) |
MACRUM | 3:3eae9fc3effb | 29 | int foo1(int x) __attribute__((section(".ARM.__at_0x18004000"))); |
MACRUM | 3:3eae9fc3effb | 30 | int foo2(int x) __attribute__((section(".ARM.__at_0x18005000"))); |
MACRUM | 3:3eae9fc3effb | 31 | int foo3(int x) __attribute__((section(".ARM.__at_0x18006000"))); |
MACRUM | 3:3eae9fc3effb | 32 | #elif defined(TARGET_LPC11U35_501) |
MACRUM | 3:3eae9fc3effb | 33 | int foo1(int x) __attribute__((section(".ARM.__at_0x00001000"))); |
MACRUM | 3:3eae9fc3effb | 34 | int foo2(int x) __attribute__((section(".ARM.__at_0x00008000"))); |
MACRUM | 3:3eae9fc3effb | 35 | int foo3(int x) __attribute__((section(".ARM.__at_0x0000F800"))); |
MACRUM | 2:4262f7e2aa9e | 36 | #else |
MACRUM | 2:4262f7e2aa9e | 37 | int foo1(int x); |
MACRUM | 2:4262f7e2aa9e | 38 | int foo2(int x); |
MACRUM | 2:4262f7e2aa9e | 39 | int foo3(int x); |
MACRUM | 1:d1898c185d3c | 40 | #endif |
MACRUM | 0:d7492cf9dab6 | 41 | |
MACRUM | 3:3eae9fc3effb | 42 | |
MACRUM | 0:d7492cf9dab6 | 43 | int main() { |
MACRUM | 3:3eae9fc3effb | 44 | pc.printf("\n*** test start ***\n"); |
MACRUM | 3:3eae9fc3effb | 45 | pc.printf("Test : foo1 = %d\n", foo1(123)); |
MACRUM | 3:3eae9fc3effb | 46 | pc.printf("Test : foo2 = %d\n", foo2(123)); |
MACRUM | 3:3eae9fc3effb | 47 | pc.printf("Test : foo3 = %d\n", foo3(123)); |
MACRUM | 3:3eae9fc3effb | 48 | pc.printf("*** test end ***\n"); |
MACRUM | 0:d7492cf9dab6 | 49 | while(1) { |
MACRUM | 0:d7492cf9dab6 | 50 | myled = 1; |
MACRUM | 0:d7492cf9dab6 | 51 | wait(0.2); |
MACRUM | 0:d7492cf9dab6 | 52 | myled = 0; |
MACRUM | 0:d7492cf9dab6 | 53 | wait(0.2); |
MACRUM | 0:d7492cf9dab6 | 54 | } |
MACRUM | 0:d7492cf9dab6 | 55 | } |
MACRUM | 0:d7492cf9dab6 | 56 | |
MACRUM | 0:d7492cf9dab6 | 57 | int foo1(int x) |
MACRUM | 0:d7492cf9dab6 | 58 | { |
MACRUM | 0:d7492cf9dab6 | 59 | return (x+1); |
MACRUM | 0:d7492cf9dab6 | 60 | } |
MACRUM | 0:d7492cf9dab6 | 61 | |
MACRUM | 0:d7492cf9dab6 | 62 | int foo2(int x) |
MACRUM | 0:d7492cf9dab6 | 63 | { |
MACRUM | 1:d1898c185d3c | 64 | return (x+2); |
MACRUM | 0:d7492cf9dab6 | 65 | } |
MACRUM | 1:d1898c185d3c | 66 | |
MACRUM | 1:d1898c185d3c | 67 | int foo3(int x) |
MACRUM | 1:d1898c185d3c | 68 | { |
MACRUM | 1:d1898c185d3c | 69 | return (x+3); |
MACRUM | 1:d1898c185d3c | 70 | } |