Toyomasa Watarai
/
test_big-size_program
Test program to generate big ROM size bin file
Diff: main.cpp
- Revision:
- 0:d7492cf9dab6
- Child:
- 1:d1898c185d3c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 27 13:58:39 2015 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +Serial pc(USBTX, USBRX); + +#define ARRAY_SIZE (64*1024) +const char data[ARRAY_SIZE] = {0}; + +int foo1(int x) __attribute__((section(".ARM.__at_0x1A020000"))); +int foo2(int x) __attribute__((section(".ARM.__at_0x1A012000"))); + +int main() { + pc.printf("data = %d, %d, %d\n", data[0], data[ARRAY_SIZE/2], data[ARRAY_SIZE - 1]); + pc.printf("foo1(123) = %d\n", foo1(123)); + pc.printf("foo2(123) = %d\n", foo2(123)); + while(1) { + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +} + +int foo1(int x) +{ + return (x+1); +} + +int foo2(int x) +{ + return (x-1); +}