Skip to content

Commit

Permalink
Merge branch 'develop' into feature/refactor-spi-flash
Browse files Browse the repository at this point in the history
  • Loading branch information
slaff authored Jun 18, 2024
2 parents 4611832 + ac79a44 commit eeaf035
Show file tree
Hide file tree
Showing 57 changed files with 185 additions and 847 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@
path = Sming/Libraries/CS5460/CS5460
url = https://github.com/xxzl0130/CS5460.git
ignore = dirty
[submodule "Libraries.CsvReader"]
path = Sming/Libraries/CsvReader
url = https://github.com/mikee47/CsvReader
ignore = dirty
[submodule "Libraries.DFRobotDFPlayerMini"]
path = Sming/Libraries/DFRobotDFPlayerMini
url = https://github.com/DFRobot/DFRobotDFPlayerMini.git
Expand Down
5 changes: 0 additions & 5 deletions Sming/Arch/Esp32/Tools/travis/build.run.sh

This file was deleted.

4 changes: 0 additions & 4 deletions Sming/Arch/Esp32/Tools/travis/build.setup.sh

This file was deleted.

16 changes: 0 additions & 16 deletions Sming/Arch/Esp32/Tools/travis/install.sh

This file was deleted.

8 changes: 0 additions & 8 deletions Sming/Arch/Esp8266/Tools/travis/build.run.sh

This file was deleted.

8 changes: 0 additions & 8 deletions Sming/Arch/Esp8266/Tools/travis/build.setup.sh

This file was deleted.

17 changes: 0 additions & 17 deletions Sming/Arch/Esp8266/Tools/travis/install.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void os_timer_setfn(os_timer_t* ptimer, os_timer_func_t* pfunction, void* parg);

static inline uint64_t os_timer_expire(const os_timer_t* ptimer)
{
if(ptimer == nullptr || int(ptimer->timer_next) == -1) {
if(ptimer == nullptr || intptr_t(ptimer->timer_next) == -1) {
return 0;
}
return ptimer->timer_expire;
Expand Down
2 changes: 1 addition & 1 deletion Sming/Arch/Host/Components/driver/os_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void os_timer_disarm(struct os_timer_t* ptimer)
{
assert(ptimer != nullptr);

if(int(ptimer->timer_next) == -1) {
if(intptr_t(ptimer->timer_next) == -1) {
return;
}

Expand Down
8 changes: 4 additions & 4 deletions Sming/Arch/Host/Components/esp_hal/include/esp_tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
extern "C" {
#endif

typedef uint32_t os_signal_t;
typedef uint32_t os_param_t;
typedef uintptr_t os_signal_t;
typedef uintptr_t os_param_t;

typedef struct {
os_signal_t sig;
Expand All @@ -32,9 +32,9 @@ void host_init_tasks();
// Hook function to process task queues
void host_service_tasks();

typedef void (*host_task_callback_t)(uint32_t param);
typedef void (*host_task_callback_t)(os_param_t param);

bool host_queue_callback(host_task_callback_t callback, uint32_t param);
bool host_queue_callback(host_task_callback_t callback, os_param_t param);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Sming/Arch/Host/Components/esp_hal/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void host_service_tasks()
}
}

bool host_queue_callback(host_task_callback_t callback, uint32_t param)
bool host_queue_callback(host_task_callback_t callback, os_param_t param)
{
return task_queues[HOST_TASK_PRIO]->post(os_signal_t(callback), param);
}
4 changes: 3 additions & 1 deletion Sming/Arch/Host/Components/hostlib/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ int main(int argc, char* argv[])
}
}

m_setPuts(&host_nputs);

host_debug_i("\nWelcome to the Sming Host emulator\n\n");

auto i = get_first_non_option();
Expand Down Expand Up @@ -309,7 +311,7 @@ int main(int argc, char* argv[])
pause(config.exitpause);

// Avoid issues with debug statements whilst running exit handlers
m_setPuts(nullptr);
m_setPuts(&host_nputs);

return exitCode;
}
27 changes: 0 additions & 27 deletions Sming/Arch/Host/Tools/travis/build.run.sh

This file was deleted.

18 changes: 0 additions & 18 deletions Sming/Arch/Host/Tools/travis/build.setup.sh

This file was deleted.

97 changes: 0 additions & 97 deletions Sming/Arch/Host/Tools/travis/coverity-scan.sh

This file was deleted.

11 changes: 0 additions & 11 deletions Sming/Arch/Host/Tools/travis/install.sh

This file was deleted.

7 changes: 6 additions & 1 deletion Sming/Arch/Host/standard.hw
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"arch": "Host",
"bootloader_size": "0x2000",
"partition_table_offset": "0x2000",
"options": ["4m"],
"devices": {
"spiFlash": {
"type": "flash",
"size": "4M"
}
},
"partitions": {
"rom0": {
"address": "0x008000",
Expand Down
9 changes: 6 additions & 3 deletions Sming/Arch/Rp2040/standard.hw
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"arch": "Rp2040",
"bootloader_size": 0,
"partition_table_offset": "self.devices[0].size - 0x1000",
"options": [
"2m"
],
"devices": {
"spiFlash": {
"type": "flash",
"size": "2M"
}
},
"partitions": {
"rom0": {
"address": 0,
Expand Down
8 changes: 4 additions & 4 deletions Sming/Components/Network/Arch/Host/Platform/StationImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void StationImpl::initialise(netif* nif)
}

auto netif_callback = [](netif* nif) {
host_queue_callback([](uint32_t param) { station.statusCallback(reinterpret_cast<netif*>(param)); },
uint32_t(nif));
host_queue_callback([](os_param_t param) { station.statusCallback(reinterpret_cast<netif*>(param)); },
os_param_t(nif));
};

netif_set_status_callback(nif, netif_callback);
Expand Down Expand Up @@ -328,15 +328,15 @@ bool StationImpl::startScan(ScanCompletedDelegate scanCompleted)
}

host_queue_callback(
[](uint32_t param) {
[](os_param_t param) {
auto self = reinterpret_cast<StationImpl*>(param);
BssList list;
for(const auto& info : apInfoList) {
list.addElement(new BssInfoImpl(info));
}
self->scanCompletedCallback(true, list);
},
uint32_t(this));
os_param_t(this));

return true;
}
Expand Down
3 changes: 2 additions & 1 deletion Sming/Components/Network/src/Data/Stream/ChunkedStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ size_t ChunkedStream::transform(const uint8_t* source, size_t sourceLength, uint
}

// Header
unsigned offset = m_snprintf(reinterpret_cast<char*>(target), targetLength, "%X\r\n", sourceLength);
unsigned offset =
m_snprintf(reinterpret_cast<char*>(target), targetLength, "%X\r\n", static_cast<unsigned>(sourceLength));

// Content
memcpy(target + offset, source, sourceLength);
Expand Down
2 changes: 1 addition & 1 deletion Sming/Components/Storage/src/include/Storage/SysMem.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SysMem : public Device
*/
Partition add(const String& name, const FSTR::ObjectBase& fstr, Partition::FullType type)
{
return PartitionTable::add(name, type, reinterpret_cast<uint32_t>(fstr.data()), fstr.size(),
return PartitionTable::add(name, type, reinterpret_cast<storage_size_t>(fstr.data()), fstr.size(),
Partition::Flag::readOnly);
}
};
Expand Down
5 changes: 3 additions & 2 deletions Sming/Components/rboot/include/Network/RbootHttpUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RbootHttpUpdater : protected HttpClient
size_t size; // << max allowed size
std::unique_ptr<RbootOutputStream> stream; // (optional) output stream to use.

Item(String url, uint32_t targetOffset, size_t size, RbootOutputStream* stream)
Item(String url, size_t targetOffset, size_t size, RbootOutputStream* stream)
: url(url), targetOffset(targetOffset), size(size), stream(stream)
{
}
Expand Down Expand Up @@ -99,7 +99,8 @@ class RbootHttpUpdater : protected HttpClient
return false;
}

return items.addNew(new Item{firmwareFileUrl, stream->getStartAddress(), stream->getMaxLength(), stream});
return items.addNew(
new Item{firmwareFileUrl, uint32_t(stream->getStartAddress()), stream->getMaxLength(), stream});
}

void start();
Expand Down
Loading

0 comments on commit eeaf035

Please sign in to comment.