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.
Fork of serial_connected_mcu by
Revision 5:4f51af2919d5, committed 2016-07-10
- Comitter:
- kachikyun
- Date:
- Sun Jul 10 07:24:41 2016 +0000
- Parent:
- 4:1323ef48a984
- Commit message:
Changed in this revision
diff -r 1323ef48a984 -r 4f51af2919d5 serial_connected_mcu_slave.cpp
--- a/serial_connected_mcu_slave.cpp Sun Jul 10 07:10:24 2016 +0000
+++ b/serial_connected_mcu_slave.cpp Sun Jul 10 07:24:41 2016 +0000
@@ -1,6 +1,10 @@
#include "serial_connected_mcu_slave.hpp"
-
+
namespace serial_connected_mcu{
+ const PinName serial_connected_mcu_slave::PIN_SERIAL_TX = SERIAL_TX;
+
+ const PinName serial_connected_mcu_slave::PIN_SERIAL_RX = SERIAL_RX;
+
serial_connected_mcu_slave::serial_connected_mcu_slave(){
port = new Serial(PIN_SERIAL_TX, PIN_SERIAL_RX);
port->baud(BAUDRATE);
@@ -67,5 +71,5 @@
array_of_read_data[i] = atoi(s.c_str());
is_locking = false;
}
-
-}
+
+}
\ No newline at end of file
diff -r 1323ef48a984 -r 4f51af2919d5 serial_connected_mcu_slave.hpp
--- a/serial_connected_mcu_slave.hpp Sun Jul 10 07:10:24 2016 +0000
+++ b/serial_connected_mcu_slave.hpp Sun Jul 10 07:24:41 2016 +0000
@@ -1,12 +1,12 @@
#ifndef SERIAL_CONNECTED_MCU_SLAVE_
#define SERIAL_CONNECTED_MCU_SLAVE_
-
+
#include "mbed.h"
#include <stdint.h>
#include <string>
#include <stdlib.h>
#include <sstream>
-
+
namespace serial_connected_mcu{
enum read_id {
ESC1,
@@ -24,7 +24,7 @@
POTENTIONMETER3,
SIZE_OF_WRITE_DATA
};
-
+
class serial_connected_mcu_slave{
public:
serial_connected_mcu_slave();
@@ -32,8 +32,8 @@
void set(int index_of_data, int16_t setting_data);
int16_t get(int index_of_data);
private:
- static const PinName PIN_SERIAL_TX = SERIAL_TX;
- static const PinName PIN_SERIAL_RX = SERIAL_RX;
+ static const PinName PIN_SERIAL_TX;
+ static const PinName PIN_SERIAL_RX;
static const int BAUDRATE = 9600;
int16_t* array_of_read_data;
int16_t* array_of_write_data;
@@ -45,4 +45,4 @@
};
}
-#endif
+#endif
\ No newline at end of file
