python-on-a-chip online compiler

Dependencies:   mbed TSI

/media/uploads/va009039/p14p-f446re.png

more info: python-on-a-chip

Committer:
va009039
Date:
Wed Jul 23 03:22:42 2014 +0000
Revision:
11:0522cf53ac30
Parent:
10:c4ad5f9ca3e4
Child:
14:5abe76ac7caf
added Nucleo L152RE(heap:72KBytes)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:65f1469d6bfb 1 /*
va009039 0:65f1469d6bfb 2 # This file is Copyright 2009 Dean Hall.
va009039 0:65f1469d6bfb 3 #
va009039 0:65f1469d6bfb 4 # This file is part of the Python-on-a-Chip program.
va009039 0:65f1469d6bfb 5 # Python-on-a-Chip is free software: you can redistribute it and/or modify
va009039 0:65f1469d6bfb 6 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
va009039 0:65f1469d6bfb 7 #
va009039 0:65f1469d6bfb 8 # Python-on-a-Chip is distributed in the hope that it will be useful,
va009039 0:65f1469d6bfb 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
va009039 0:65f1469d6bfb 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
va009039 0:65f1469d6bfb 11 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
va009039 0:65f1469d6bfb 12 # is seen in the file COPYING up one directory from this.
va009039 0:65f1469d6bfb 13 */
va009039 0:65f1469d6bfb 14
va009039 0:65f1469d6bfb 15
va009039 0:65f1469d6bfb 16 #include "pm.h"
va009039 0:65f1469d6bfb 17
va009039 5:19bd98307341 18 #if defined(TARGET_LPC1768)
va009039 0:65f1469d6bfb 19 #define HEAP_SIZE 0x7000
va009039 8:88d4fba4ccd5 20 #define USRLIB_IMG (uint8_t*)77824
va009039 8:88d4fba4ccd5 21
va009039 5:19bd98307341 22 #elif defined(TARGET_LPC1549)
va009039 5:19bd98307341 23 #define HEAP_SIZE 0x8000
va009039 8:88d4fba4ccd5 24 #define USRLIB_IMG (uint8_t*)61440
va009039 8:88d4fba4ccd5 25
va009039 5:19bd98307341 26 #elif defined(TARGET_KL46Z)
va009039 5:19bd98307341 27 #define HEAP_SIZE 0x7000
va009039 8:88d4fba4ccd5 28 #define USRLIB_IMG (uint8_t*)73728
va009039 8:88d4fba4ccd5 29
va009039 5:19bd98307341 30 #elif defined(TARGET_KL25Z)
va009039 5:19bd98307341 31 #define HEAP_SIZE 0x3400
va009039 8:88d4fba4ccd5 32 #define USRLIB_IMG (uint8_t*)73728
va009039 8:88d4fba4ccd5 33
va009039 6:e428c1e68f0c 34 #elif defined(TARGET_LPC4088)
va009039 6:e428c1e68f0c 35 #define HEAP_SIZE 0xf000
va009039 8:88d4fba4ccd5 36 #define USRLIB_IMG (uint8_t*)73728
va009039 8:88d4fba4ccd5 37
va009039 7:71a6f45bc563 38 #elif defined(TARGET_NUCLEO_F401RE)
va009039 8:88d4fba4ccd5 39 #define HEAP_SIZE 0x15000
va009039 8:88d4fba4ccd5 40 #define USRLIB_IMG (uint8_t*)69632
va009039 8:88d4fba4ccd5 41
va009039 8:88d4fba4ccd5 42 #elif defined(TARGET_LPC11U68)
va009039 8:88d4fba4ccd5 43 #define HEAP_SIZE 0x7000
va009039 8:88d4fba4ccd5 44 #define USRLIB_IMG (uint8_t*)61440
va009039 8:88d4fba4ccd5 45
va009039 9:2bba4682879b 46 #elif defined(TARGET_NUCLEO_F411RE)
va009039 9:2bba4682879b 47 #define HEAP_SIZE 0x1f000
va009039 9:2bba4682879b 48 #define USRLIB_IMG (uint8_t*)69632
va009039 9:2bba4682879b 49
va009039 10:c4ad5f9ca3e4 50 #elif defined(TARGET_NUCLEO_F103RB)
va009039 10:c4ad5f9ca3e4 51 #define HEAP_SIZE 0x4000
va009039 10:c4ad5f9ca3e4 52 #define USRLIB_IMG (uint8_t*)69632
va009039 10:c4ad5f9ca3e4 53
va009039 11:0522cf53ac30 54 #elif defined(TARGET_NUCLEO_L152RE)
va009039 11:0522cf53ac30 55 #define HEAP_SIZE 0x12000
va009039 11:0522cf53ac30 56 #define USRLIB_IMG (uint8_t*)69632
va009039 11:0522cf53ac30 57
va009039 5:19bd98307341 58 #else
va009039 5:19bd98307341 59 #error "target error"
va009039 3:559c4bd38111 60 #endif
va009039 0:65f1469d6bfb 61
va009039 5:19bd98307341 62 uint8_t heap[HEAP_SIZE];
va009039 0:65f1469d6bfb 63
va009039 0:65f1469d6bfb 64 int
va009039 0:65f1469d6bfb 65 main(void)
va009039 0:65f1469d6bfb 66 {
va009039 0:65f1469d6bfb 67 PmReturn_t retval;
va009039 0:65f1469d6bfb 68
va009039 8:88d4fba4ccd5 69 retval = pm_init(heap, HEAP_SIZE, MEMSPACE_PROG, USRLIB_IMG);
va009039 0:65f1469d6bfb 70 PM_RETURN_IF_ERROR(retval);
va009039 0:65f1469d6bfb 71
va009039 0:65f1469d6bfb 72 /* Run the sample program */
va009039 0:65f1469d6bfb 73 retval = pm_run((uint8_t *)"main");
va009039 0:65f1469d6bfb 74
va009039 0:65f1469d6bfb 75 return (int)retval;
va009039 0:65f1469d6bfb 76 }