Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface mbed-rtos
PortBase.cpp
00001 /******************************************* 00002 * PortBase.h 00003 * @author Yuki Suga 00004 * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010. 00005 * @license LGPLv3 00006 *****************************************/ 00007 #define RTNO_SUBMODULE_DEFINE 00008 00009 #include <stdlib.h> 00010 #include <string.h> 00011 #include "PortBase.h" 00012 #include "NullBuffer.h" 00013 00014 PortBase* PortBase_create() { 00015 return (PortBase*)malloc(sizeof(PortBase)); 00016 } 00017 00018 void PortBase_init(PortBase* portBase, const char* name, char typeCode, PortBuffer* dataBuffer) 00019 { 00020 portBase->pName = (char*)malloc(strlen(name)+1); 00021 strcpy(portBase->pName, name); 00022 portBase->typeCode = typeCode; 00023 portBase->pPortBuffer = dataBuffer; 00024 } 00025 00026 void PortBase_destroy(PortBase* pPortBase) 00027 { 00028 free(pPortBase->pName); 00029 free(pPortBase); 00030 }
Generated on Fri Jul 22 2022 21:22:49 by
1.7.2