Add free() function to memory pool to get number of free chunks.

m17
Rob Riggs 2021-08-02 20:29:00 -05:00
rodzic 175f005427
commit dd48ad5b0e
3 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -3,6 +3,7 @@
#include "HdlcFrame.hpp"
#include "Log.h"
#include "main.h"
#include "cmsis_os.h"
namespace mobilinkd { namespace tnc { namespace hdlc {

Wyświetl plik

@ -37,7 +37,7 @@ public:
DATA = 0, TX_DELAY, P_PERSIST, SLOT_TIME, TX_TAIL, DUPLEX, HARDWARE,
TEXT, LOG};
enum Source { RF_DATA = 0x80 };
enum Source { RF_DATA = 0x80, BERT = 0x30, STREAM = 0x20, PACKET = 0x10 };
private:
data_type data_;

Wyświetl plik

@ -65,6 +65,8 @@ struct Pool {
free_list.push_back(*item);
taskEXIT_CRITICAL_FROM_ISR(x);
}
size_t free() const { return free_list.size(); }
};