Skip to content

Commit ed863e6

Browse files
authored
Merge pull request #725 from ut-issl/main
Main merge to develop for v8.0.3 update
2 parents 8361399 + a413790 commit ed863e6

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

src/components/real/cdh/c2a_communication.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#ifndef C2A_COMMUNICATION_H_
77
#define C2A_COMMUNICATION_H_
88

9-
namespace s2e::components {
10-
119
// If the character encoding of C2A is UTF-8, the following functions are not necessary,
1210
// and users can directory use SendFromObc_C2A and ReceivedByObc_C2A UART
1311
// TODO: Delete these functions since C2A is changed to use UTF-8
@@ -25,6 +23,4 @@ int OBC_C2A_I2cReadRegister(int port_id, const unsigned char i2c_address, unsign
2523
int OBC_C2A_GpioWrite(int port_id, const bool is_high);
2624
bool OBC_C2A_GpioRead(int port_id); // return false when the port_id is not used
2725

28-
} // namespace s2e::components
29-
3026
#endif // C2A_COMMUNICATION_H_

src/components/real/cdh/on_board_computer_with_c2a.cpp

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,6 @@ int ObcWithC2a::ReceivedByObc_C2A(int port_id, unsigned char* buffer, int offset
133133
return port->ReadRx(buffer, offset, length);
134134
}
135135

136-
// If the character encoding of C2A is UTF-8, these functions are not necessary,
137-
// and users can directory use SendFromObc_C2A and ReceivedByObc_C2A
138-
int OBC_C2A_SendFromObc(int port_id, unsigned char* buffer, int offset, int length) {
139-
return ObcWithC2a::SendFromObc_C2A(port_id, buffer, offset, length);
140-
}
141-
int OBC_C2A_ReceivedByObc(int port_id, unsigned char* buffer, int offset, int length) {
142-
return ObcWithC2a::ReceivedByObc_C2A(port_id, buffer, offset, length);
143-
}
144-
145136
int ObcWithC2a::I2cConnectPort(int port_id, const unsigned char i2c_address) {
146137
if (i2c_com_ports_c2a_[port_id] != nullptr) {
147138
// Port already used
@@ -212,16 +203,6 @@ int ObcWithC2a::I2cComponentReadCommand(int port_id, const unsigned char i2c_add
212203
return 0;
213204
}
214205

215-
int OBC_C2A_I2cWriteCommand(int port_id, const unsigned char i2c_address, const unsigned char* data, const unsigned char length) {
216-
return ObcWithC2a::I2cWriteCommand(port_id, i2c_address, data, length);
217-
}
218-
int OBC_C2A_I2cWriteRegister(int port_id, const unsigned char i2c_address, const unsigned char* data, const unsigned char length) {
219-
return ObcWithC2a::I2cWriteRegister(port_id, i2c_address, data, length);
220-
}
221-
int OBC_C2A_I2cReadRegister(int port_id, const unsigned char i2c_address, unsigned char* data, const unsigned char length) {
222-
return ObcWithC2a::I2cReadRegister(port_id, i2c_address, data, length);
223-
}
224-
225206
int ObcWithC2a::GpioConnectPort(int port_id) {
226207
if (gpio_ports_c2a_[port_id] != nullptr) {
227208
// Port already used
@@ -255,8 +236,28 @@ bool ObcWithC2a::GpioRead_C2A(int port_id) {
255236
return port->DigitalRead();
256237
}
257238

258-
int OBC_C2A_GpioWrite(int port_id, const bool is_high) { return ObcWithC2a::GpioWrite_C2A(port_id, is_high); }
239+
} // namespace s2e::components
259240

260-
bool OBC_C2A_GpioRead(int port_id) { return ObcWithC2a::GpioRead_C2A(port_id); }
241+
// C2A用
242+
// If the character encoding of C2A is UTF-8, these functions are not necessary,
243+
// and users can directory use SendFromObc_C2A and ReceivedByObc_C2A
244+
int OBC_C2A_SendFromObc(int port_id, unsigned char* buffer, int offset, int length) {
245+
return s2e::components::ObcWithC2a::SendFromObc_C2A(port_id, buffer, offset, length);
246+
}
247+
int OBC_C2A_ReceivedByObc(int port_id, unsigned char* buffer, int offset, int length) {
248+
return s2e::components::ObcWithC2a::ReceivedByObc_C2A(port_id, buffer, offset, length);
249+
}
261250

262-
} // namespace s2e::components
251+
int OBC_C2A_I2cWriteCommand(int port_id, const unsigned char i2c_address, const unsigned char* data, const unsigned char length) {
252+
return s2e::components::ObcWithC2a::I2cWriteCommand(port_id, i2c_address, data, length);
253+
}
254+
int OBC_C2A_I2cWriteRegister(int port_id, const unsigned char i2c_address, const unsigned char* data, const unsigned char length) {
255+
return s2e::components::ObcWithC2a::I2cWriteRegister(port_id, i2c_address, data, length);
256+
}
257+
int OBC_C2A_I2cReadRegister(int port_id, const unsigned char i2c_address, unsigned char* data, const unsigned char length) {
258+
return s2e::components::ObcWithC2a::I2cReadRegister(port_id, i2c_address, data, length);
259+
}
260+
261+
int OBC_C2A_GpioWrite(int port_id, const bool is_high) { return s2e::components::ObcWithC2a::GpioWrite_C2A(port_id, is_high); }
262+
263+
bool OBC_C2A_GpioRead(int port_id) { return s2e::components::ObcWithC2a::GpioRead_C2A(port_id); }

0 commit comments

Comments
 (0)