Norimasa Okamoto
/
pymite
python-on-a-chip online compiler
- http://pymbed.appspot.com/
- https://code.google.com/p/python-on-a-chip/
- http://www.youtube.com/watch?v=Oyqc2bFRW9I
- https://bitbucket.org/va009039/pymbed/
more info: python-on-a-chip
platform/mbed/main.cpp@3:559c4bd38111, 2013-03-13 (annotated)
- Committer:
- va009039
- Date:
- Wed Mar 13 10:05:34 2013 +0000
- Revision:
- 3:559c4bd38111
- Parent:
- 0:65f1469d6bfb
- Child:
- 4:23becb24acb8
add TARGET_KL25Z
Who changed what in which revision?
User | Revision | Line number | New 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 | 0:65f1469d6bfb | 18 | |
va009039 | 0:65f1469d6bfb | 19 | #ifdef __cplusplus |
va009039 | 0:65f1469d6bfb | 20 | extern |
va009039 | 0:65f1469d6bfb | 21 | #endif |
va009039 | 0:65f1469d6bfb | 22 | |
va009039 | 3:559c4bd38111 | 23 | #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) |
va009039 | 0:65f1469d6bfb | 24 | #define HEAP_SIZE 0x7000 |
va009039 | 3:559c4bd38111 | 25 | #endif |
va009039 | 3:559c4bd38111 | 26 | #if defined(TARGET_KL25Z) |
va009039 | 3:559c4bd38111 | 27 | #define HEAP_SIZE 0x3000 |
va009039 | 3:559c4bd38111 | 28 | #endif |
va009039 | 0:65f1469d6bfb | 29 | |
va009039 | 0:65f1469d6bfb | 30 | unsigned char const usrlib_img[]; |
va009039 | 0:65f1469d6bfb | 31 | |
va009039 | 0:65f1469d6bfb | 32 | |
va009039 | 0:65f1469d6bfb | 33 | int |
va009039 | 0:65f1469d6bfb | 34 | main(void) |
va009039 | 0:65f1469d6bfb | 35 | { |
va009039 | 0:65f1469d6bfb | 36 | uint8_t heap[HEAP_SIZE]; |
va009039 | 0:65f1469d6bfb | 37 | PmReturn_t retval; |
va009039 | 0:65f1469d6bfb | 38 | |
va009039 | 0:65f1469d6bfb | 39 | retval = pm_init(heap, HEAP_SIZE, MEMSPACE_PROG, usrlib_img); |
va009039 | 0:65f1469d6bfb | 40 | PM_RETURN_IF_ERROR(retval); |
va009039 | 0:65f1469d6bfb | 41 | |
va009039 | 0:65f1469d6bfb | 42 | /* Run the sample program */ |
va009039 | 0:65f1469d6bfb | 43 | retval = pm_run((uint8_t *)"main"); |
va009039 | 0:65f1469d6bfb | 44 | |
va009039 | 0:65f1469d6bfb | 45 | return (int)retval; |
va009039 | 0:65f1469d6bfb | 46 | } |