Revision f8cf404d components/ControllerAreaNetworkRx.cpp
components/ControllerAreaNetworkRx.cpp | ||
---|---|---|
5 | 5 |
#include <amiro/Constants.h> |
6 | 6 |
#include <amiro/ControllerAreaNetworkRx.h> |
7 | 7 |
|
8 |
#include <global.hpp> |
|
9 |
|
|
8 | 10 |
using namespace chibios_rt; |
9 | 11 |
using namespace amiro; |
10 | 12 |
|
13 |
extern Global global; |
|
14 |
|
|
11 | 15 |
using namespace types; |
12 | 16 |
using namespace amiro::constants; |
13 | 17 |
|
... | ... | |
36 | 40 |
msg_t ControllerAreaNetworkRx::receiveSensorVal(CANRxFrame *frame) { |
37 | 41 |
int deviceId = this->decodeDeviceId(frame); |
38 | 42 |
|
39 |
// chprintf((BaseSequentialStream*) &SD1, "DeviceId: %d\r\n",deviceId);
|
|
43 |
// chprintf((BaseSequentialStream*) &global.sercanmux1, "DeviceId: %d\r\n",deviceId);
|
|
40 | 44 |
|
41 | 45 |
switch (deviceId) { |
42 | 46 |
case CAN::PROXIMITY_RING_ID(0): |
... | ... | |
72 | 76 |
break; |
73 | 77 |
|
74 | 78 |
case CAN::PROXIMITY_FLOOR_ID: |
75 |
// chprintf((BaseSequentialStream*) &SD1, "CAN::PROXIMITY_FLOOR_ID");
|
|
79 |
// chprintf((BaseSequentialStream*) &global.sercanmux1, "CAN::PROXIMITY_FLOOR_ID");
|
|
76 | 80 |
if (frame->DLC == 8) { |
77 | 81 |
proximityFloorValue[0] = frame->data16[0]; |
78 | 82 |
proximityFloorValue[1] = frame->data16[1]; |
... | ... | |
192 | 196 |
CANRxFrame rxframe; |
193 | 197 |
msg_t message = canReceive(this->canDriver, CAN_ANY_MAILBOX, &rxframe, TIME_IMMEDIATE); |
194 | 198 |
if (message == RDY_OK) { |
195 |
// chprintf((BaseSequentialStream*) &SD1, "Rx Message");
|
|
199 |
// chprintf((BaseSequentialStream*) &global.sercanmux1, "Rx Message");
|
|
196 | 200 |
message = this->receiveMessage(&rxframe); |
197 | 201 |
if (message != RDY_OK) |
198 | 202 |
this->receiveSensorVal(&rxframe); |
Also available in: Unified diff