Skip to content

Commit

Permalink
Use upstreamed modm::Stusb4500 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Mar 9, 2021
1 parent 903b99c commit d9141d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 135 deletions.
12 changes: 6 additions & 6 deletions firmware_modm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "hardware.hpp"

#include "stusb4500.hpp"
#include <modm/driver/usb/stusb4500.hpp>

// modm::IODeviceWrapper<modm::platform::UsbUart0, modm::IOBuffer::DiscardIfFull> loggerDevice;
// modm::log::Logger modm::log::debug(loggerDevice);
Expand All @@ -43,7 +43,7 @@ using namespace modm::literals;

modm::Pid<float, 1> pid;

Stusb4500<Iron::Display::MyI2cMaster> usb{};
modm::Stusb4500<Iron::Display::MyI2cMaster> usb{};

class AdcThread : public modm::pt::Protothread
{
Expand Down Expand Up @@ -245,16 +245,16 @@ int main()
Iron::Ui::initialize();


RF_CALL_BLOCKING(usb.configurePdo(0, 5000, 500));
RF_CALL_BLOCKING(usb.configurePdo(1, 20000, 1500));
RF_CALL_BLOCKING(usb.configurePdo(2, 20000, 4000));
RF_CALL_BLOCKING(usb.configurePdo(1, 5000, 500));
RF_CALL_BLOCKING(usb.configurePdo(2, 20000, 1500));
RF_CALL_BLOCKING(usb.configurePdo(3, 20000, 4000));

// pdo number expected {1,2,3}
RF_CALL_BLOCKING(usb.setValidPdo(3));

// check results
modm::delay(200ms);
stusb4500::RdoRegStatusData status = RF_CALL_BLOCKING(usb.getRdoRegStatus());
modm::stusb4500::RdoRegStatusData status = RF_CALL_BLOCKING(usb.getRdoRegStatus());
auto r = Iron::AnalogReadings::readAll();

Iron::Display::initialize();
Expand Down
1 change: 1 addition & 0 deletions firmware_modm/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<module>modm:processing:protothread</module>
<module>modm:processing:timer</module>
<module>modm:driver:ssd1306</module>
<module>modm:driver:stusb4500</module>
<module>modm:container</module>
<module>modm:platform:i2c:1</module>
<module>modm:platform:timer:1</module>
Expand Down
129 changes: 0 additions & 129 deletions firmware_modm/stusb4500.hpp

This file was deleted.

0 comments on commit d9141d6

Please sign in to comment.