00001 #ifndef Waypoints_h 00002 #define Waypoints_h 00003 00004 #include <inttypes.h> 00005 #include "WProgram.h" 00006 #include <avr/eeprom.h> 00007 00008 class Waypoints 00009 { 00010 public: 00011 Waypoints(); 00012 00013 struct WP { 00014 uint8_t id; // for commands 00015 int8_t p1; // for commands 00016 int32_t alt; // Altitude in centimeters (meters * 100) 00017 int32_t lat; // Lattitude * 10**7 00018 int32_t lng; // Longitude * 10**7 00019 }; 00020 00021 WP get_waypoint_with_index(uint8_t i); 00022 WP get_current_waypoint(void); 00023 00024 void set_waypoint_with_index(Waypoints::WP wp, uint8_t i); 00025 00026 void set_start_byte(uint16_t start_byte); 00027 void set_wp_size(uint8_t wp_size); 00028 00029 void next_index(void); 00030 uint8_t get_index(void); 00031 void set_index(uint8_t i); 00032 00033 uint8_t get_total(void); 00034 void set_total(uint8_t total); 00035 00036 00037 00038 private: 00039 uint16_t _start_byte; 00040 uint8_t _wp_size; 00041 uint8_t _index; 00042 uint8_t _total; 00043 }; 00044 00045 #endif 00046