.
Dependencies: L432KC_SPI_Pey_Lal
Diff: main.cpp
- Revision:
- 110:a6d1d3525014
- Parent:
- 109:4ee7ffc8f175
- Child:
- 111:f11575e7c79b
--- a/main.cpp Tue Apr 05 13:34:51 2022 +0000 +++ b/main.cpp Thu Apr 07 12:13:04 2022 +0000 @@ -5,9 +5,6 @@ #include "mbed.h" #include "platform/mbed_thread.h" -#include <string.h> -#include <stdio.h> -#include <stdlib.h> #include <SPISlave.h> #include "protocol.h" @@ -54,16 +51,13 @@ device.format(8); while (true) { - if (device.receive()) + if(device.receive()) { - decodeMessage((char)device.read()); + //decodeMessage((char)device.read()); } - if (isDataAvailable()) + if(isDataAvailable()) { - uint32_t pwms[2]; - getVerifiedPWMValues(pwms); - pulsewidth_propulsion = pwms[0]; - pulsewidth_direction = pwms[1]; + getVerifiedPWMValues(&pulsewidth_propulsion, &pulsewidth_direction); propulsion.pulsewidth_us(pulsewidth_propulsion); direction.pulsewidth_us(pulsewidth_direction); }