mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 18:31:37 +00:00
most of the changes needed to build native on Windows
This commit is contained in:
parent
4e8e85c9f1
commit
abe95ae1a4
@ -7,8 +7,6 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A printer that doesn't go anywhere
|
* A printer that doesn't go anywhere
|
||||||
*/
|
*/
|
||||||
|
@ -44,8 +44,6 @@ class Screen
|
|||||||
#define BRIGHTNESS_DEFAULT 150
|
#define BRIGHTNESS_DEFAULT 150
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace graphics
|
namespace graphics
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
#include <queue>
|
#include <queue>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/// We clear our old flood record five minute after we see the last of it
|
/// We clear our old flood record five minute after we see the last of it
|
||||||
#define FLOOD_EXPIRE_TIME (5 * 60 * 1000L)
|
#define FLOOD_EXPIRE_TIME (5 * 60 * 1000L)
|
||||||
|
|
||||||
@ -23,7 +21,7 @@ struct PacketRecord {
|
|||||||
class PacketRecordHashFunction
|
class PacketRecordHashFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
size_t operator()(const PacketRecord &p) const { return (hash<NodeNum>()(p.sender)) ^ (hash<PacketId>()(p.id)); }
|
size_t operator()(const PacketRecord &p) const { return (std::hash<NodeNum>()(p.sender)) ^ (std::hash<PacketId>()(p.id)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Order packet records by arrival time, we want the oldest packets to be in the front of our heap
|
/// Order packet records by arrival time, we want the oldest packets to be in the front of our heap
|
||||||
@ -54,7 +52,7 @@ class PacketHistory
|
|||||||
/** FIXME: really should be a std::unordered_set with the key being sender,id.
|
/** FIXME: really should be a std::unordered_set with the key being sender,id.
|
||||||
* This would make checking packets in wasSeenRecently faster.
|
* This would make checking packets in wasSeenRecently faster.
|
||||||
*/
|
*/
|
||||||
vector<PacketRecord> recentPackets;
|
std::vector<PacketRecord> recentPackets;
|
||||||
// priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes;
|
// priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes;
|
||||||
// unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets;
|
// unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ struct PendingPacket {
|
|||||||
class GlobalPacketIdHashFunction
|
class GlobalPacketIdHashFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
size_t operator()(const GlobalPacketId &p) const { return (hash<NodeNum>()(p.node)) ^ (hash<PacketId>()(p.id)); }
|
size_t operator()(const GlobalPacketId &p) const { return (std::hash<NodeNum>()(p.node)) ^ (std::hash<PacketId>()(p.id)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,7 +60,7 @@ class GlobalPacketIdHashFunction
|
|||||||
class ReliableRouter : public FloodingRouter
|
class ReliableRouter : public FloodingRouter
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending;
|
std::unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../nrf52/wifi-stubs.cpp
|
|
Loading…
Reference in New Issue
Block a user