kopia lustrzana https://github.com/ogre/pizero_tracker
master
rodzic
1d4ae602f7
commit
0197f1b6f0
|
@ -219,7 +219,7 @@ int main1(int argc, char** argv)
|
|||
GLOB::get().nmea_set(current_nmea);
|
||||
GLOB::get().gps_fix_now(); // typical time since uBlox msg read to here is under 1 millisecond
|
||||
GLOB::get().dynamics_add("alt", std::chrono::steady_clock::now(), current_nmea.alt);
|
||||
cout<<C_MAGENTA<<"alt "<<GLOB::get().dynamics_get("alt").str()<<C_OFF<<endl;
|
||||
// cout<<C_MAGENTA<<"alt "<<GLOB::get().dynamics_get("alt").str()<<C_OFF<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +314,10 @@ int main1(int argc, char** argv)
|
|||
if( ssdv_tiles.size() )
|
||||
{
|
||||
auto tile = ssdv_tiles.next_tile();
|
||||
cout<<"Send SSDV @RF"<<endl;
|
||||
cout<<"Send SSDV @RF. Left tiles: "<<ssdv_tiles.size()<<endl;
|
||||
// for(int i=0; i<256; ++i)
|
||||
// cout<<" 0x"<<hex<<(int)(tile[i]);
|
||||
// cout<<dec<<endl;
|
||||
mtx2_write( radio_fd, tile.data(), sizeof(tile) );
|
||||
if(!ssdv_tiles.size()) // delete image when done
|
||||
system( (string("rm -f ") + G.cli.ssdv_image + " || echo \"Can't delete SSDV image.\"").c_str() );
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "ssdv_t.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
size_t ssdv_t::load_file(const std::string file_path)
|
||||
{
|
||||
|
@ -9,10 +10,11 @@ size_t ssdv_t::load_file(const std::string file_path)
|
|||
return 0;
|
||||
|
||||
tile_t tile;
|
||||
memset(tile.data(), 0x00, sizeof(tile));
|
||||
size_t total_tiles = 0;
|
||||
while(1)
|
||||
{
|
||||
const size_t read_bytes = fread( tile.data(), sizeof(char), 256, p_file );
|
||||
const size_t read_bytes = fread( tile.data(), 1, sizeof(tile), p_file );
|
||||
if(!read_bytes)
|
||||
return total_tiles;
|
||||
tiles_que_.push_back(tile);
|
||||
|
|
|
@ -10,7 +10,7 @@ class ssdv_t
|
|||
|
||||
public:
|
||||
using tile_t = std::array<char, 256>;
|
||||
bool size() const { return tiles_que_.size(); }
|
||||
size_t size() const { return tiles_que_.size(); }
|
||||
size_t load_file(const std::string file_path);
|
||||
tile_t next_tile(); // pop tile from que and return
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue