Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / flight / libraries / PyMite / platform / openpilot / plat.c
blob7f8e105468ee4332223e8dcc5ecc1d975635f6c3
1 /**
2 * @file plat.c
3 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
4 * @brief PyMite platform definitions for OpenPilot
6 * @see The GNU Public License (GPL) Version 3
8 *****************************************************************************/
9 /*
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "pm.h"
26 #include "openpilot.h"
28 int pylinenum;
30 PmReturn_t plat_init(void)
32 return PM_RET_OK;
35 PmReturn_t plat_deinit(void)
37 return PM_RET_OK;
41 * Gets a byte from the address in the designated memory space
42 * Post-increments *paddr.
44 uint8_t plat_memGetByte(PmMemSpace_t memspace, uint8_t const **paddr)
46 uint8_t b = 0;
48 switch (memspace)
50 case MEMSPACE_RAM:
51 case MEMSPACE_PROG:
52 b = **paddr;
53 *paddr += 1;
54 return b;
55 case MEMSPACE_EEPROM:
56 case MEMSPACE_SEEPROM:
57 case MEMSPACE_OTHER0:
58 case MEMSPACE_OTHER1:
59 case MEMSPACE_OTHER2:
60 case MEMSPACE_OTHER3:
61 default:
62 return 0;
66 PmReturn_t plat_getByte(uint8_t *b)
68 return PM_RET_ERR;
71 PmReturn_t plat_putByte(uint8_t b)
73 return PM_RET_ERR;
76 PmReturn_t plat_getMsTicks(uint32_t *r_ticks)
78 *r_ticks = xTaskGetTickCount() * portTICK_RATE_MS;
79 return PM_RET_OK;
82 void plat_reportError(PmReturn_t result)
84 /* TODO: Copy error information to UAVObject */
85 /* gVmGlobal.errVmRelease gVmGlobal.errFileId gVmGlobal.errLineNum */