Davi Souza
/
pymite
python
Fork of pymite by
Diff: platform/mbed/main_nat.cpp
- Revision:
- 5:19bd98307341
- Parent:
- 4:23becb24acb8
- Child:
- 7:71a6f45bc563
diff -r 23becb24acb8 -r 19bd98307341 platform/mbed/main_nat.cpp --- a/platform/mbed/main_nat.cpp Sat Mar 16 13:29:02 2013 +0000 +++ b/platform/mbed/main_nat.cpp Fri Apr 11 12:18:37 2014 +0000 @@ -285,7 +285,11 @@ { NativeClassInterface nci; - return nci.method<Serial,int,&Serial::baud>(OBJ_TYPE_NON, OBJ_TYPE_INT); + Serial* obj; + nci._load_obj<Serial>(&obj); + obj->baud(nci.argv<int>(1)); + return nci.set_return_value<int>(OBJ_TYPE_INT, 0); + //return nci.method<Serial,int,&Serial::baud>(OBJ_TYPE_NON, OBJ_TYPE_INT); } @@ -294,8 +298,12 @@ { NativeClassInterface nci; - return nci.method<int,Serial,&Serial::readable>(OBJ_TYPE_INT); - + Serial* obj; + nci._load_obj<Serial>(&obj); + int r = obj->readable(); + return nci.set_return_value<int>(OBJ_TYPE_INT, r); + //return nci.method<int,Serial,&Serial::readable>(OBJ_TYPE_INT); + } PmReturn_t @@ -303,7 +311,11 @@ { NativeClassInterface nci; - return nci.method<int,Serial,&Serial::writeable>(OBJ_TYPE_INT); + Serial* obj; + nci._load_obj<Serial>(&obj); + int r = obj->writeable(); + return nci.set_return_value<int>(OBJ_TYPE_INT, r); + //return nci.method<int,Serial,&Serial::writeable>(OBJ_TYPE_INT); }