Skip to content

Commit

Permalink
Trying to compile the code with the latest develop version.
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed Mar 12, 2021
1 parent 813c08e commit c664f92
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
14 changes: 14 additions & 0 deletions Sming/Arch/Host/Core/SPI.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "SPI.h"

bool SPIClass::begin()
{
return false;
}

void SPIClass::transfer(uint8_t* buffer, size_t numberBytes)
{
}

void SPIClass::prepare(SPISettings& settings)
{
}
14 changes: 4 additions & 10 deletions Sming/Arch/Host/Core/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,18 @@
class SPIClass : public SPIBase
{
public:
bool begin() override
{
return false;
}
bool begin() override;

void end() override
{
}

using SPIBase::beginTransaction;
using SPIBase::transfer;
void transfer(uint8_t* buffer, size_t numberBytes) override
{
}
void transfer(uint8_t* buffer, size_t numberBytes) override;

protected:
void prepare(SPISettings& settings) override
{
}
void prepare(SPISettings& settings) override;
};

/** @brief Global instance of SPI class */
Expand Down
14 changes: 4 additions & 10 deletions Sming/Components/Hosted-Lib/src/SpiHosted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ extern HostedClient* hostedClient;
// define the static singleton
SPIClass SPI;

void SPIClass::begin()
bool SPIClass::begin()
{
NEW_HD_COMMAND(message, SpiBeginTransaction, { command->has_settings = 0; });

hostedClient->send(&message);
return hostedClient->send(&message);
}

void SPIClass::beginTransaction(SPISettings mySettings)
void SPIClass::prepare(SPISettings& mySettings)
{
NEW_HD_COMMAND(message, SpiBeginTransaction, {
command->has_settings = 1;
command->settings.speed = mySettings.speed;
// command->settings.speed = mySettings.speed;
command->settings.byteOrder = SpiSettings_ByteOrder(mySettings.byteOrder);
command->settings.dataMode = SpiSettings_DataMode(mySettings.dataMode);
});
Expand Down Expand Up @@ -58,9 +58,3 @@ void SPIClass::transfer(uint8_t* buffer, size_t numberBytes)
resultData->readBytes(reinterpret_cast<char*>(buffer), numberBytes);
delete resultData;
}

uint32_t SPIClass::transfer32(uint32_t val, uint8_t bits)
{
// TODO:
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class HostedTcpStream : public ReadWriteStream
{
public:
HostedTcpStream(const String& host, uint16_t port) : host(host), port(port), buffer(1024)
HostedTcpStream(const String& host, uint16_t port) : buffer(1024), host(host), port(port)
{
auto onCompleted = [](TcpClient& client, bool successful) {
// onCompleted;
Expand Down
2 changes: 1 addition & 1 deletion Sming/Components/Hosted/src/HostedClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class HostedClient
return true;
},
.state = this->stream,
.bytes_left = this->stream->available(),
.bytes_left = (size_t)this->stream->available(),
.errmsg = nullptr,
};
}
Expand Down

0 comments on commit c664f92

Please sign in to comment.