Commit 5fcffdf0 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk Committed by Projects

adding compass app

parent bb68b1fd
#include <bitmaps.h>
static const uint8_t gps_disconnected_data[] = {
0x0a,
0x80,
0x0d,
0x80,
static const uint8_t comp_circle_data[] = {
0x20,
0x8d,
0x3d,
0x84,
0x0b,
0x84,
0x03,
0x36,
0x83,
0x13,
0x83,
0x30,
0x83,
0x19,
0x83,
0x2b,
0x82,
0x04,
0x80,
0x04,
0x81,
0x06,
0x80,
0x03,
0x1f,
0x82,
0x27,
0x82,
0x23,
0x82,
0x24,
0x81,
0x03,
0x27,
0x81,
0x06,
0x21,
0x82,
0x00,
0x83,
0x06,
0x29,
0x82,
0x02,
0x80,
0x07,
0x83,
0x01,
0x80,
0x01,
0x1e,
0x81,
0x2d,
0x81,
0x1c,
0x81,
0x2f,
0x81,
0x1a,
0x81,
0x31,
0x81,
0x18,
0x81,
0x33,
0x81,
0x16,
0x81,
0x35,
0x81,
0x14,
0x81,
0x37,
0x81,
0x12,
0x81,
0x39,
0x81,
0x10,
0x81,
0x3b,
0x81,
0x0e,
0x81,
0x3d,
0x81,
0x0d,
0x80,
0x05,
0x83,
0x03,
0x3f,
0x80,
0x06,
0x84,
0x00,
0x0c,
0x81,
0x3f,
0x81,
0x07,
0x85,
0x0a,
0x81,
0x41,
0x81,
0x09,
0x84,
0x08,
0x86,
0x05};
const struct rle_bitmap gps_disconnected = { 15, 15, gps_disconnected_data };
static const uint8_t date_icon_data[] = {
0x10,
0x8a,
0x03,
0x80,
0x08,
0x80,
0x03,
0x8a,
0x03,
0x43,
0x80,
0x08,
0x81,
0x43,
0x81,
0x07,
0x80,
0x03,
0x80,
0x01,
0x83,
0x02,
0x45,
0x80,
0x03,
0x06,
0x81,
0x45,
0x81,
0x05,
0x80,
0x04,
0x47,
0x80,
0x02,
0x05,
0x80,
0x03,
0x47,
0x80,
0x04,
0x81,
0x47,
0x81,
0x03,
0x80,
0x03,
0x49,
0x80,
0x03,
0x80,
0x04,
0x49,
0x80,
0x02,
0x80,
0x03,
0x80,
0x01,
0x80,
0x81,
0x49,
0x81,
0x01,
0x80,
0x02,
0x80,
0x03,
0x4b,
0x80,
0x02,
0x81,
0x01,
0x82,
0x03,
0x80,
0x05,
0x4b,
0x80,
0x01,
0x80,
0x03,
0x80,
0x05,
0x4b,
0x80,
0x00,
0x80,
0x04,
0x88,
0x12};
const struct rle_bitmap date_icon = { 15, 15, date_icon_data };
static const uint8_t gps_receiving_data[] = {
0x06,
0x83,
0x0e,
0x80,
0x0a,
0x81,
0x01,
0x80,
0x04,
0x84,
0x01,
0x4b,
0x82,
0x05,
0x4d,
0x81,
0x03,
0x82,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0x8d,
0x00};
const struct rle_bitmap battery_charging = { 15, 12, battery_charging_data };
static const uint8_t gps_searching_data[] = {
0x0c,
0x80,
0x0c,
0x80,
0x13,
0x82,
0x03,
0x80,
0x05,
0x4d,
0x81,
0x04,
0x80,
0x05,
0x4d,
0x81,
0x03,
0x4d,
0x81,
0x06,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x81,
0x4d,
0x82,
0x4b,
0x81,
0x00,
0x83,
0x06,
0x82,
0x02,
0x80,
0x07,
0x83,
0x4b,
0x80,
0x01,
0x80,
0x4b,
0x80,
0x01,
0x80,
0x05,
0x83,
0x03,
0x4b,
0x80,
0x06,
0x84,
0x00,
0x01,
0x81,
0x07,
0x85,
0x0a,
0x49,
0x81,
0x09,
0x84,
0x08,
0x86,
0x05};
const struct rle_bitmap gps_searching = { 15, 15, gps_searching_data };
static const uint8_t clock_icon_data[] = {
0x03,
0x00,
0x84,
0x07,
0x00,
0x80,
0x04,
0x80,
0x00,
0x04,
0x02,
0x80,
0x03,
0x49,
0x80,
0x03,
0x80,
0x02,
0x00,
0x04,
0x80,
0x04,
0x00,
0x01,
0x80,
0x04,
0x49,
0x80,
0x03,
0x81,
0x47,
0x81,
0x04,
0x80,
0x00,
0x00,
0x05,
0x47,
0x80,
0x05,
0x00,
0x80,
0x05,
0x47,
0x80,
0x05,
0x81,
0x05,
0x80,
0x05,
0x45,
0x81,
0x06,
0x80,
0x04,
0x45,
0x80,
0x00,
0x07,
0x81,
0x43,
0x81,
0x08,
0x80,
0x03,
0x00,
0x00,
0x80,
0x0a,
0x43,
0x80,
0x01,
0x00,
0x09,
0x81,
0x41,
0x81,
0x0a,
0x00,
0x02,
0x80,
0x08,
0x81,
0x3f,
0x81,
0x0c,
0x80,
0x04,
0x00,
0x3f,
0x80,
0x04,
0x80,
0x00,
0x07,
0x00,
0x82,
0x00,
0x04};
const struct rle_bitmap clock_icon = { 15, 15, clock_icon_data };
static const uint8_t example_icon_data[] = {
0x2e,
0x0d,
0x81,
0x05,
0x3d,
0x81,
0x04,
0x0e,
0x81,
0x3b,
0x81,
0x10,
0x81,
0x39,
0x81,
0x12,
0x81,
0x37,
0x81,
0x14,
0x81,
0x35,
0x81,
0x05,
0x82,
0x16,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x08,
0x80,
0x09,
0x80,
0x02,
0x80,
0x08,
0x81,
0x02,
0x33,
0x81,
0x06,
0x18,
0x81,
0x04,
0x83,
0x01,
0x31,
0x81,
0x1a,
0x81,
0x2f,
0x81,
0x1c,
0x81,
0x2d,
0x81,
0x1e,
0x82,
0x08,
0x29,
0x82,
0x21,
0x81,
0x27,
0x81,
0x24,
0x82,
0x23,
0x82,
0x27,
0x82,
0x1f,
0x82,
0x2b,
0x83,
0x14};
const struct rle_bitmap example_icon = { 15, 15, example_icon_data };
0x19,
0x83,
0x30,
0x83,
0x13,
0x83,
0x36,
0x84,
0x0b,
0x84,
0x3d,
0x8d,
0x20};
const struct rle_bitmap comp_circle = { 80, 80, comp_circle_data };
static const uint8_t compass_arrow_data[] = {
0x08,
static const uint8_t battery_data[] = {
0x8d,
0x00,
0x80,
0x11,
0x0b,
0x80,
0x11,
0x00,
0x80,
0x10,
0x82,
0x0f,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x82,
0x0f,
0x0b,
0x82,
0x0f,
0x0b,
0x82,
0x0f,
0x0b,
0x82,
0x0f,
0x0b,
0x82,
0x0e,
0x84,
0x0d,
0x84,
0x0d,
0x84,
0x0d,
0x84,
0x0d,
0x84,
0x0c,
0x86,
0x0b,
0x86,
0x82,
0x0b,
0x86,
0x80,
0x00,
0x80,
0x0b,
0x86,
0x80,
0x00,
0x8d,
0x00};
const struct rle_bitmap battery = { 15, 12, battery_data };
static const uint8_t battery_charging_data[] = {
0x8d,
0x00,
0x80,
0x0b,
0x86,
0x80,
0x00,
0x80,
0x0b,
0x86,
0x0a,
0x88,
0x09,
0x88,
0x09,
0x88,
0x09,
0x88,
0x09,
0x88,
0x08,
0x8a,
0x07,
0x8a,
0x07,
0x8a,
0x07,
0x8a,
0x07,
0x8a,
0x06,
0x8c,
0x05,
0x8c,
0x05,
0x8c,
0x05,
0x8c,
0x05,
0x8c,
0x80,
0x00,
0x80,
0x05,
0x8c,
0x04,
0x8e,
0x03,
0x8e,
0x81,
0x03,
0x8e,
0x82,
0x04,
0x84,
0x01,
0x82,
0x00,
0x86,
0x03,
0x8e,
0x82,
0x00,
0x86,
0x03,
0x8e,
0x02,
0x90,
0x01,
0x90,
0x01,
0x90,
0x01,
0x90,
0x01,
0x90,
0x82,
0x04,
0x84,
0x01,
0x90,
0x82,
0x05,
0x81,
0x03,
0x82,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0xb8};
const struct rle_bitmap compass_arrow = { 19, 50, compass_arrow_data };
0x8d,
0x00};
const struct rle_bitmap battery_charging = { 15, 12, battery_charging_data };
static const uint8_t gps_receiving_data[] = {
0x06,
0x83,
0x0e,
static const uint8_t gps_searching_data[] = {
0x0c,
0x80,
0x0a,
0x81,
0x01,
0x0c,
0x80,
0x04,
0x13,
0x82,
0x03,
0x80,
0x01,
0x80,
0x02,
0x05,
0x81,
0x06,
0x80,
0x00,
0x04,
0x80,
0x01,
0x05,
0x81,
0x03,
0x81,
0x01,
0x80,
0x00,
0x80,
0x01,
0x06,
0x82,
0x00,
0x83,
0x03,
0x80,
0x01,
0x06,
0x82,
0x02,
0x80,
......@@ -472,43 +424,2161 @@ static const uint8_t gps_receiving_data[] = {
0x08,
0x86,
0x05};
const struct rle_bitmap gps_receiving = { 15, 15, gps_receiving_data };
const struct rle_bitmap gps_searching = { 15, 15, gps_searching_data };
static const uint8_t settings_icon_data[] = {
static const uint8_t comp_ico_data[] = {
0x04,
0x80,
0x02,
0x80,
0x09,
0x81,
0x0d,
0x81,
0x0c,
0x81,
0x08,
0x01,
0x80,
0x09,
0x80,
0x00,
0x80,
0x00,
0x80,
0x09,
0x80,
0x01,
0x82,
0x08,
0x85,
0x81,
0x09,
0x85,
0x0c,
0x82,
0x80,
0x02,
0x80,
0x1a,
0x80,
0x0c,
0x82,
0x0a,
0x80,
0x00,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x06};
const struct rle_bitmap comp_ico = { 15, 15, comp_ico_data };
static const uint8_t gps_disconnected_data[] = {
0x0a,
0x80,
0x0d,
0x80,
0x0b,
0x84,
0x03,
0x82,
0x04,
0x80,
0x04,
0x81,
0x06,
0x80,
0x03,
0x81,
0x03,
0x81,
0x06,
0x82,
0x00,
0x83,
0x06,
0x82,
0x02,
0x80,
0x07,
0x83,
0x01,
0x80,
0x01,
0x80,
0x05,
0x83,
0x03,
0x80,
0x06,
0x84,
0x00,
0x81,
0x07,
0x85,
0x0a,
0x81,
0x09,
0x84,
0x08,
0x86,
0x05};
const struct rle_bitmap gps_disconnected = { 15, 15, gps_disconnected_data };
static const uint8_t comp_arrow_data[] = {
0x05,
0x82,
0x0b,
0x82,
0x0b,
0x82,
0x0a,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x08,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x06,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x04,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x02,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x00,
0xad,
0x0c,
0x81,
0x0c,
0x80,
0x00,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x02,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x04,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x06,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x08,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x0a,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x82,
0x05};
const struct rle_bitmap comp_arrow = { 15, 70, comp_arrow_data };
static const uint8_t comp_circle2_data[] = {
0x33,
0x8f,
0x61,
0x86,
0x0d,
0x86,
0x57,
0x84,
0x19,
0x84,
0x50,
0x83,
0x21,
0x83,
0x4b,
0x82,
0x27,
0x82,
0x47,
0x82,
0x2b,
0x82,
0x42,
0x83,
0x2f,
0x83,
0x3e,
0x81,
0x35,
0x81,
0x3b,
0x82,
0x37,
0x82,
0x37,
0x82,
0x3b,
0x82,
0x34,
0x81,
0x3f,
0x81,
0x31,
0x82,
0x41,
0x82,
0x2e,
0x81,
0x45,
0x81,
0x2c,
0x81,
0x47,
0x81,
0x2a,
0x81,
0x49,
0x81,
0x27,
0x82,
0x4b,
0x82,
0x24,
0x81,
0x4f,
0x81,
0x22,
0x81,
0x51,
0x81,
0x20,
0x81,
0x53,
0x81,
0x1e,
0x81,
0x55,
0x81,
0x1d,
0x80,
0x57,
0x80,
0x1c,
0x81,
0x57,
0x81,
0x1a,
0x81,
0x59,
0x81,
0x18,
0x81,
0x5b,
0x81,
0x16,
0x81,
0x5d,
0x81,
0x15,
0x80,
0x5f,
0x80,
0x14,
0x81,
0x5f,
0x81,
0x12,
0x81,
0x61,
0x81,
0x11,
0x80,
0x63,
0x80,
0x10,
0x81,
0x63,
0x81,
0x0f,
0x80,
0x65,
0x80,
0x0e,
0x81,
0x65,
0x81,
0x0c,
0x81,
0x67,
0x81,
0x0b,
0x80,
0x69,
0x80,
0x0b,
0x80,
0x69,
0x80,
0x0a,
0x81,
0x69,
0x81,
0x09,
0x80,
0x6b,
0x80,
0x08,
0x81,
0x6b,
0x81,
0x07,
0x80,
0x6d,
0x80,
0x06,
0x81,
0x6d,
0x81,
0x05,
0x80,
0x6f,
0x80,
0x05,
0x80,
0x6f,
0x80,
0x04,
0x81,
0x6f,
0x81,
0x03,
0x80,
0x71,
0x80,
0x03,
0x80,
0x71,
0x80,
0x03,
0x80,
0x71,
0x80,
0x02,
0x81,
0x71,
0x81,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x00,
0x81,
0x73,
0x82,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x81,
0x75,
0x82,
0x73,
0x81,
0x00,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x80,
0x73,
0x80,
0x01,
0x81,
0x71,
0x81,
0x02,
0x80,
0x71,
0x80,
0x03,
0x80,
0x71,
0x80,
0x03,
0x80,
0x71,
0x80,
0x03,
0x81,
0x6f,
0x81,
0x04,
0x80,
0x6f,
0x80,
0x05,
0x80,
0x6f,
0x80,
0x05,
0x81,
0x6d,
0x81,
0x06,
0x80,
0x6d,
0x80,
0x07,
0x81,
0x6b,
0x81,
0x08,
0x80,
0x6b,
0x80,
0x09,
0x81,
0x69,
0x81,
0x0a,
0x80,
0x69,
0x80,
0x0b,
0x80,
0x69,
0x80,
0x0b,
0x81,
0x67,
0x81,
0x0c,
0x81,
0x65,
0x81,
0x0e,
0x80,
0x65,
0x80,
0x0f,
0x81,
0x63,
0x81,
0x10,
0x80,
0x63,
0x80,
0x11,
0x81,
0x61,
0x81,
0x12,
0x81,
0x5f,
0x81,
0x14,
0x80,
0x5f,
0x80,
0x15,
0x81,
0x5d,
0x81,
0x16,
0x81,
0x5b,
0x81,
0x18,
0x81,
0x59,
0x81,
0x1a,
0x81,
0x57,
0x81,
0x1c,
0x80,
0x57,
0x80,
0x1d,
0x81,
0x55,
0x81,
0x1e,
0x81,
0x53,
0x81,
0x20,
0x81,
0x51,
0x81,
0x22,
0x81,
0x4f,
0x81,
0x24,
0x82,
0x4b,
0x82,
0x27,
0x81,
0x49,
0x81,
0x2a,
0x81,
0x47,
0x81,
0x2c,
0x81,
0x45,
0x81,
0x2e,
0x82,
0x41,
0x82,
0x31,
0x81,
0x3f,
0x81,
0x34,
0x82,
0x3b,
0x82,
0x37,
0x82,
0x37,
0x82,
0x3b,
0x81,
0x35,
0x81,
0x3e,
0x83,
0x2f,
0x83,
0x42,
0x82,
0x2b,
0x82,
0x47,
0x82,
0x27,
0x82,
0x4b,
0x83,
0x21,
0x83,
0x50,
0x84,
0x19,
0x84,
0x57,
0x86,
0x0d,
0x86,
0x61,
0x8f,
0x33};
const struct rle_bitmap comp_circle2 = { 120, 120, comp_circle2_data };
static const uint8_t gps_receiving_data[] = {
0x06,
0x83,
0x0e,
0x80,
0x0a,
0x81,
0x01,
0x80,
0x04,
0x82,
0x03,
0x80,
0x01,
0x80,
0x02,
0x81,
0x06,
0x80,
0x00,
0x80,
0x01,
0x81,
0x03,
0x81,
0x01,
0x80,
0x00,
0x80,
0x01,
0x82,
0x00,
0x83,
0x03,
0x80,
0x01,
0x82,
0x02,
0x80,
0x07,
0x83,
0x01,
0x80,
0x01,
0x80,
0x05,
0x83,
0x03,
0x80,
0x06,
0x84,
0x00,
0x81,
0x07,
0x85,
0x0a,
0x81,
0x09,
0x84,
0x08,
0x86,
0x05};
const struct rle_bitmap gps_receiving = { 15, 15, gps_receiving_data };
static const uint8_t comp_arrow2_data[] = {
0x05,
0x82,
0x0b,
0x82,
0x0b,
0x82,
0x0b,
0x82,
0x0b,
0x82,
0x0a,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x09,
0x84,
0x08,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x07,
0x86,
0x06,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x05,
0x88,
0x04,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x03,
0x8a,
0x02,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x01,
0x8c,
0x00,
0xcb,
0x0c,
0x81,
0x0c,
0x81,
0x0c,
0x81,
0x0c,
0x80,
0x00,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x01,
0x80,
0x0a,
0x80,
0x02,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x03,
0x80,
0x08,
0x80,
0x04,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x05,
0x80,
0x06,
0x80,
0x06,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x07,
0x80,
0x04,
0x80,
0x08,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x09,
0x80,
0x02,
0x80,
0x0a,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x80,
0x00,
0x80,
0x0b,
0x82,
0x05};
const struct rle_bitmap comp_arrow2 = { 15, 110, comp_arrow2_data };
static const uint8_t comp_circle3_data[] = {
0x33,
0x90,
0x62,
0x9a,
0x59,
0x89,
0x06,
0x80,
0x06,
0x89,
0x52,
0x87,
0x0b,
0x80,
0x0b,
0x87,
0x4c,
0x86,
0x0f,
0x80,
0x0f,
0x86,
0x47,
0x85,
0x12,
0x80,
0x12,
0x85,
0x43,
0x84,
0x15,
0x80,
0x15,
0x84,
0x3f,
0x84,
0x17,
0x80,
0x17,
0x84,
0x3b,
0x84,
0x19,
0x80,
0x19,
0x84,
0x38,
0x83,
0x1b,
0x80,
0x1b,
0x83,
0x35,
0x83,
0x1d,
0x80,
0x1d,
0x83,
0x32,
0x83,
0x1e,
0x80,
0x1e,
0x83,
0x2f,
0x83,
0x20,
0x80,
0x20,
0x83,
0x2c,
0x83,
0x21,
0x80,
0x21,
0x83,
0x2a,
0x83,
0x22,
0x80,
0x22,
0x83,
0x28,
0x82,
0x24,
0x80,
0x24,
0x82,
0x26,
0x82,
0x25,
0x80,
0x25,
0x82,
0x24,
0x82,
0x26,
0x80,
0x26,
0x82,
0x22,
0x82,
0x27,
0x80,
0x27,
0x82,
0x20,
0x83,
0x27,
0x80,
0x27,
0x83,
0x1e,
0x82,
0x01,
0x80,
0x26,
0x80,
0x26,
0x80,
0x01,
0x82,
0x1c,
0x82,
0x03,
0x80,
0x25,
0x80,
0x25,
0x80,
0x03,
0x82,
0x1a,
0x82,
0x05,
0x80,
0x24,
0x80,
0x24,
0x80,
0x05,
0x82,
0x18,
0x82,
0x07,
0x80,
0x23,
0x80,
0x23,
0x80,
0x07,
0x82,
0x17,
0x82,
0x08,
0x80,
0x22,
0x80,
0x22,
0x80,
0x08,
0x82,
0x16,
0x82,
0x0a,
0x80,
0x21,
0x80,
0x21,
0x80,
0x0a,
0x82,
0x14,
0x82,
0x0c,
0x80,
0x20,
0x80,
0x20,
0x80,
0x0c,
0x82,
0x13,
0x81,
0x0e,
0x80,
0x1f,
0x80,
0x1f,
0x80,
0x0e,
0x81,
0x12,
0x82,
0x0f,
0x80,
0x1e,
0x80,
0x1e,
0x80,
0x0f,
0x82,
0x10,
0x82,
0x11,
0x80,
0x1d,
0x80,
0x1d,
0x80,
0x11,
0x82,
0x0f,
0x81,
0x13,
0x80,
0x1c,
0x80,
0x1c,
0x80,
0x13,
0x81,
0x0e,
0x82,
0x14,
0x80,
0x1b,
0x80,
0x1b,
0x80,
0x14,
0x82,
0x0d,
0x81,
0x16,
0x80,
0x1a,
0x80,
0x1a,
0x80,
0x16,
0x81,
0x0c,
0x82,
0x17,
0x80,
0x19,
0x80,
0x19,
0x80,
0x17,
0x82,
0x0b,
0x81,
0x19,
0x80,
0x18,
0x80,
0x18,
0x80,
0x19,
0x81,
0x0a,
0x82,
0x1a,
0x80,
0x17,
0x80,
0x17,
0x80,
0x1a,
0x82,
0x09,
0x81,
0x1c,
0x80,
0x16,
0x80,
0x16,
0x80,
0x1c,
0x81,
0x08,
0x82,
0x1d,
0x80,
0x15,
0x80,
0x15,
0x80,
0x1d,
0x82,
0x07,
0x81,
0x1f,
0x80,
0x14,
0x80,
0x14,
0x80,
0x1f,
0x81,
0x07,
0x81,
0x20,
0x80,
0x13,
0x80,
0x13,
0x80,
0x20,
0x81,
0x06,
0x82,
0x21,
0x80,
0x12,
0x80,
0x12,
0x80,
0x21,
0x82,
0x05,
0x81,
0x23,
0x80,
0x11,
0x80,
0x11,
0x80,
0x23,
0x81,
0x05,
0x81,
0x24,
0x80,
0x10,
0x80,
0x10,
0x80,
0x24,
0x81,
0x04,
0x82,
0x25,
0x80,
0x0f,
0x80,
0x0f,
0x80,
0x25,
0x82,
0x03,
0x81,
0x27,
0x80,
0x0e,
0x80,
0x0e,
0x80,
0x27,
0x81,
0x03,
0x81,
0x28,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x28,
0x81,
0x03,
0x81,
0x29,
0x80,
0x0c,
0x80,
0x0c,
0x80,
0x29,
0x81,
0x02,
0x82,
0x2a,
0x80,
0x0b,
0x80,
0x0b,
0x80,
0x2a,
0x82,
0x01,
0x81,
0x2c,
0x80,
0x0a,
0x80,
0x0a,
0x80,
0x2c,
0x81,
0x01,
0x81,
0x2d,
0x80,
0x09,
0x80,
0x09,
0x80,
0x2d,
0x81,
0x01,
0x81,
0x2e,
0x80,
0x08,
0x80,
0x08,
0x80,
0x2e,
0x81,
0x01,
0x81,
0x2f,
0x80,
0x07,
0x80,
0x07,
0x80,
0x2f,
0x81,
0x00,
0x82,
0x30,
0x80,
0x06,
0x80,
0x06,
0x80,
0x30,
0x84,
0x32,
0x80,
0x05,
0x80,
0x05,
0x80,
0x32,
0x83,
0x33,
0x80,
0x04,
0x80,
0x04,
0x80,
0x33,
0x83,
0x34,
0x80,
0x03,
0x80,
0x03,
0x80,
0x34,
0x83,
0x35,
0x80,
0x02,
0x80,
0x02,
0x80,
0x35,
0x83,
0x36,
0x80,
0x01,
0x80,
0x01,
0x80,
0x36,
0x83,
0x37,
0x80,
0x00,
0x80,
0x00,
0x80,
0x37,
0x83,
0x38,
0x82,
0x38,
0xfc,
0x38,
0x82,
0x38,
0x83,
0x37,
0x80,
0x00,
0x80,
0x00,
0x80,
0x37,
0x83,
0x36,
0x80,
0x01,
0x80,
0x01,
0x80,
0x36,
0x83,
0x35,
0x80,
0x02,
0x80,
0x02,
0x80,
0x35,
0x83,
0x34,
0x80,
0x03,
0x80,
0x03,
0x80,
0x34,
0x83,
0x33,
0x80,
0x04,
0x80,
0x04,
0x80,
0x33,
0x83,
0x32,
0x80,
0x05,
0x80,
0x05,
0x80,
0x32,
0x84,
0x30,
0x80,
0x06,
0x80,
0x06,
0x80,
0x30,
0x82,
0x00,
0x81,
0x2f,
0x80,
0x07,
0x80,
0x07,
0x80,
0x2f,
0x81,
0x01,
0x81,
0x2e,
0x80,
0x08,
0x80,
0x08,
0x80,
0x2e,
0x81,
0x01,
0x81,
0x2d,
0x80,
0x09,
0x80,
0x09,
0x80,
0x2d,
0x81,
0x01,
0x81,
0x2c,
0x80,
0x0a,
0x80,
0x0a,
0x80,
0x2c,
0x81,
0x01,
0x82,
0x2a,
0x80,
0x0b,
0x80,
0x0b,
0x80,
0x2a,
0x82,
0x02,
0x81,
0x29,
0x80,
0x0c,
0x80,
0x0c,
0x80,
0x29,
0x81,
0x03,
0x81,
0x28,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x28,
0x81,
0x03,
0x81,
0x27,
0x80,
0x0e,
0x80,
0x0e,
0x80,
0x27,
0x81,
0x03,
0x82,
0x25,
0x80,
0x0f,
0x80,
0x0f,
0x80,
0x25,
0x82,
0x04,
0x81,
0x24,
0x80,
0x10,
0x80,
0x10,
0x80,
0x24,
0x81,
0x05,
0x81,
0x23,
0x80,
0x11,
0x80,
0x11,
0x80,
0x23,
0x81,
0x05,
0x82,
0x21,
0x80,
0x12,
0x80,
0x12,
0x80,
0x21,
0x82,
0x06,
0x81,
0x20,
0x80,
0x13,
0x80,
0x13,
0x80,
0x20,
0x81,
0x07,
0x81,
0x1f,
0x80,
0x14,
0x80,
0x14,
0x80,
0x1f,
0x81,
0x07,
0x82,
0x1d,
0x80,
0x15,
0x80,
0x15,
0x80,
0x1d,
0x82,
0x08,
0x81,
0x1c,
0x80,
0x16,
0x80,
0x16,
0x80,
0x1c,
0x81,
0x09,
0x82,
0x1a,
0x80,
0x17,
0x80,
0x17,
0x80,
0x1a,
0x82,
0x0a,
0x81,
0x19,
0x80,
0x18,
0x80,
0x18,
0x80,
0x19,
0x81,
0x0b,
0x82,
0x17,
0x80,
0x19,
0x80,
0x19,
0x80,
0x17,
0x82,
0x0c,
0x81,
0x16,
0x80,
0x1a,
0x80,
0x1a,
0x80,
0x16,
0x81,
0x0d,
0x82,
0x14,
0x80,
0x1b,
0x80,
0x1b,
0x80,
0x14,
0x82,
0x0e,
0x81,
0x13,
0x80,
0x1c,
0x80,
0x1c,
0x80,
0x13,
0x81,
0x0f,
0x82,
0x11,
0x80,
0x1d,
0x80,
0x1d,
0x80,
0x11,
0x82,
0x10,
0x82,
0x0f,
0x80,
0x1e,
0x80,
0x1e,
0x80,
0x0f,
0x82,
0x12,
0x81,
0x0e,
0x80,
0x1f,
0x80,
0x1f,
0x80,
0x0e,
0x81,
0x13,
0x82,
0x0c,
0x85,
0x09,
0x85,
0x80,
0x20,
0x80,
0x20,
0x80,
0x0c,
0x82,
0x14,
0x82,
0x0a,
0x80,
0x21,
0x80,
0x21,
0x80,
0x0a,
0x82,
0x16,
0x82,
0x08,
0x80,
0x22,
0x80,
0x22,
0x80,
0x08,
0x82,
0x17,
0x82,
0x07,
0x80,
0x23,
0x80,
0x23,
0x80,
0x07,
0x82,
0x18,
0x82,
0x05,
0x80,
0x24,
0x80,
0x24,
0x80,
0x05,
0x82,
0x1a,
0x82,
0x03,
0x80,
0x25,
0x80,
0x25,
0x80,
0x03,
0x82,
0x1c,
0x82,
0x01,
0x80,
0x08,
0x26,
0x80,
0x26,
0x80,
0x01,
0x82,
0x1e,
0x83,
0x27,
0x80,
0x27,
0x83,
0x20,
0x82,
0x27,
0x80,
0x27,
0x82,
0x22,
0x82,
0x26,
0x80,
0x26,
0x82,
0x24,
0x82,
0x25,
0x80,
0x25,
0x82,
0x26,
0x82,
0x24,
0x80,
0x24,
0x82,
0x28,
0x83,
0x22,
0x80,
0x22,
0x83,
0x2a,
0x83,
0x21,
0x80,
0x21,
0x83,
0x2c,
0x83,
0x20,
0x80,
0x20,
0x83,
0x2f,
0x83,
0x1e,
0x80,
0x1e,
0x83,
0x32,
0x83,
0x1d,
0x80,
0x1d,
0x83,
0x35,
0x83,
0x1b,
0x80,
0x1b,
0x83,
0x38,
0x84,
0x19,
0x80,
0x19,
0x84,
0x3b,
0x84,
0x17,
0x80,
0x17,
0x84,
0x3f,
0x84,
0x15,
0x80,
0x15,
0x84,
0x43,
0x85,
0x12,
0x80,
0x12,
0x85,
0x47,
0x86,
0x0f,
0x80,
0x0f,
0x86,
0x4c,
0x87,
0x0b,
0x80,
0x0b,
0x87,
0x52,
0x89,
0x06,
0x80,
0x06,
0x89,
0x59,
0x9a,
0x62,
0x90,
0x33};
const struct rle_bitmap comp_circle3 = { 121, 121, comp_circle3_data };
static const uint8_t example_icon_data[] = {
0x2e,
0x81,
0x0c,
0x05,
0x81,
0x04,
0x81,
0x05,
0x82,
0x16,
0x80,
0x0d,
0x80,
0x0d,
0x80,
0x08,
0x80,
0x09,
0x80,
0x02,
0x80,
0x08,
0x81,
0x02,
0x81,
0x06,
0x81,
0x02};
const struct rle_bitmap settings_icon = { 15, 15, settings_icon_data };
0x04,
0x83,
0x01,
0x82,
0x08,
0x83,
0x14};
const struct rle_bitmap example_icon = { 15, 15, example_icon_data };
......@@ -10,15 +10,17 @@ struct rle_bitmap
const uint8_t *data;
};
extern const struct rle_bitmap gps_disconnected;
extern const struct rle_bitmap date_icon;
extern const struct rle_bitmap gps_receiving;
extern const struct rle_bitmap comp_circle;
extern const struct rle_bitmap battery;
extern const struct rle_bitmap clock_icon;
extern const struct rle_bitmap example_icon;
extern const struct rle_bitmap battery_charging;
extern const struct rle_bitmap gps_searching;
extern const struct rle_bitmap settings_icon;
extern const struct rle_bitmap compass_arrow;
extern const struct rle_bitmap comp_ico;
extern const struct rle_bitmap gps_disconnected;
extern const struct rle_bitmap comp_arrow;
extern const struct rle_bitmap comp_circle2;
extern const struct rle_bitmap gps_receiving;
extern const struct rle_bitmap comp_arrow2;
extern const struct rle_bitmap comp_circle3;
extern const struct rle_bitmap example_icon;
#endif /* BITMAPS_H */
sw/bitmaps/example_icon.bmp

842 Bytes | W: | H:

sw/bitmaps/example_icon.bmp

774 Bytes | W: | H:

sw/bitmaps/example_icon.bmp
sw/bitmaps/example_icon.bmp
sw/bitmaps/example_icon.bmp
sw/bitmaps/example_icon.bmp
  • 2-up
  • Swipe
  • Onion skin
......@@ -117,6 +117,8 @@ INCLUDEPATHS += \
-I../common/CMSIS/Include \
-I../common/Device/EnergyMicro/EFM32GG/Include \
-I../common \
-I../common/usb \
-I../common/usb/inc \
-I../common/emlib/inc \
-I../common/emdrv/sleep/inc \
......@@ -167,6 +169,14 @@ C_SRC += \
../common/gfx/graphics.c \
../common/gfx/gfx.c \
../common/gfx/ui.c \
../common/sincos.c \
../common/usb/src/em_usbd.c \
../common/usb/src/em_usbdch9.c \
../common/usb/src/em_usbhal.c \
../common/usb/src/em_usbdep.c \
../common/usb/src/em_usbdint.c \
../common/usb/src/em_usbtimer.c \
../common/usb/usbdesc.c \
FreeRTOS/Source/timers.c \
FreeRTOS/Source/tasks.c \
FreeRTOS/Source/queue.c \
......
......@@ -29,18 +29,55 @@
#include <drivers/LSM303C/lsm303c.h>
#include <bitmaps.h>
#include <sincos.h>
#include <usbdesc.h>
#define COMPASS_R 50
#define COMPASS_X0 64
#define COMPASS_Y0 64
#define COMP_R 50.0
#define COMP_X0 64
#define COMP_Y0 64
static int x_lcd, y_lcd;
static float sina, cosa;
static int calib;
lsm303_smpl iron;
static void compass_redraw(struct ui_widget *w)
{
static int angle, ff;
int arr_h, arr_w, cir_h, cir_w;
char buf[20];
arr_h = comp_arrow2.h;
arr_w = comp_arrow2.w;
cir_h = comp_circle2.h;
cir_w = comp_circle2.w;
//if(angle == 0) ff=1;
//else if(angle == 180) ff=0;
//if(ff) angle += 10;
//else angle -= 10;
//sina = 2; cosa = 2;
//angle +=1;
//if(angle == 180) angle=-180;
gfx_clear(&w->dc, 0);
//gfx_draw_bitmap(&w->dc, 64, 64, &compass_arrow);
gfx_line(&w->dc, COMPASS_X0, COMPASS_Y0, x_lcd, y_lcd, 1);
//gfx_line(&w->dc, COMP_X0, COMP_Y0, x_lcd, y_lcd, 1);
if(!calib) {
gfx_draw_bitmap(&w->dc, COMP_X0-cir_w/2, COMP_Y0-cir_h/2, &comp_circle2);
gfx_draw_bitmap_rotate(&w->dc, COMP_X0-arr_w/2, COMP_Y0-arr_h/2, &comp_arrow2,
COMP_X0, COMP_Y0, angle, sina, cosa);
}
if(calib==1) {
sprintf(buf, "Calibration");
gfx_centered_text(&w->dc, &font_helv17, 60, buf, COLOR_BLACK);
}
if(calib==2) {
sprintf(buf, "ix: %d", iron.x);
gfx_text(&w->dc, &font_helv17, 10, 30, buf, COLOR_BLACK);
sprintf(buf, "iy: %d", iron.y);
gfx_text(&w->dc, &font_helv17, 10, 60, buf, COLOR_BLACK);
sprintf(buf, "iz: %d", iron.z);
gfx_text(&w->dc, &font_helv17, 10, 90, buf, COLOR_BLACK);
}
}
static void compass_event(struct ui_widget *w, const struct event *evt)
......@@ -69,12 +106,15 @@ void compass_main(void *params)
(void)(params);
struct event evt;
lsm303_smpl acc, mag;
int pitch, roll, xh, yh, x_comp, y_comp;
lsm303_smpl c_max, c_min;
int pitch, roll, xh, yh, th, x_comp, y_comp;
unsigned int x2, y2, z2;
float xy_mean;
char buf[50];
/*lsm303 init, we need both ACC & MAG for tilt/roll compensation*/
lsm303_init();
USBD_Init(&initstruct);
ui_clear();
ui_init_widget(&compass_screen);
......@@ -97,32 +137,68 @@ void compass_main(void *params)
case BUTTON_PRESSED:
if(evt.data.button == BUT_TR)
return;
if(evt.data.button == BUT_BR) {
c_min.x = 0x7fff;
c_min.y = 0x7fff;
c_min.z = 0x7fff;
c_max.x = -0x7fff;
c_max.y = -0x7fff;
c_max.z = -0x7fff;
calib = 1;
}
if(evt.data.button == BUT_BL && calib) {
iron = lsm303_calib_iron(&c_max, &c_min);
calib = 2;
}
if(evt.data.button == BUT_TL && calib==2) {
calib = 0;
}
}
}
else {
lsm303_get_sample(DEV_ACC, &acc);
lsm303_get_sample(DEV_MAG, &mag);
/* calculate pitch and roll from accelerometer */
x2 = acc.x * acc.x;
y2 = acc.y * acc.y;
z2 = acc.z * acc.z;
pitch = -small_atan(acc.x, small_sqrt(acc.y*acc.y + acc.z*acc.z));
roll = small_atan(acc.y, small_sqrt(acc.x*acc.x + acc.z*acc.z));
/* work with compass readout, first revert it because magnetic south is north */
mag.x *= -1;
mag.y *= -1;
mag.z *= -1;
/*now calculate heading based on MAG readout and pinch/roll*/
xh = mag.x*small_cos(pitch) + mag.z*small_sin(pitch);
yh = mag.x*small_sin(roll)*small_sin(pitch) + mag.y*small_cos(roll) -
mag.z*small_sin(roll)*small_cos(pitch);
/* calculate x,y for compass in cartesian */
xy_mean = small_sqrt(xh*xh + yh*yh);
x_comp = COMPASS_R*yh / xy_mean;
y_comp = COMPASS_R*xh / xy_mean;
/* transform to LCD coordinates */
x_lcd = x_comp + COMPASS_X0;
y_lcd = -y_comp + COMPASS_Y0;
if(calib==1) {
/* we try to find min and max for axis to calibrate */
if(mag.x > c_max.x) c_max.x = mag.x;
if(mag.x < c_min.x) c_min.x = mag.x;
if(mag.y > c_max.y) c_max.y = mag.y;
if(mag.y < c_min.y) c_min.y = mag.y;
if(mag.z > c_max.z) c_max.z = mag.z;
if(mag.z < c_min.z) c_min.z = mag.z;
}
if(!calib) {
/* calculate pitch and roll from accelerometer */
x2 = acc.x * acc.x;
y2 = acc.y * acc.y;
z2 = acc.z * acc.z;
pitch = -small_atan(acc.x, small_sqrt(acc.y*acc.y + acc.z*acc.z));
roll = small_atan(acc.y, small_sqrt(acc.x*acc.x + acc.z*acc.z));
sprintf(buf, "p: %d, r: %d\n\r", pitch, roll);
USBD_Write(USBDESC_EP_DATA_OUT, (void*)buf, strlen(buf), NULL);
/* work with compass readout, first revert it because magnetic south is north */
mag.x *= -1;
mag.y *= -1;
mag.z *= -1;
/*now calculate heading based on MAG readout and pinch/roll*/
xh = (int)((float)mag.x*small_cos(pitch) + (float)mag.z*small_sin(pitch));
yh = (int)((float)mag.x*small_sin(roll)*small_sin(pitch) + (float)mag.y*small_cos(roll) -
(float)mag.z*small_sin(roll)*small_cos(pitch));
/* LCD is rotated 90 degrees, so xh = yh and yh=-xh */
th = xh;
xh = yh;
yh = -th;
/* calculate x,y for compass in cartesian */
xy_mean = small_sqrt(xh*xh + yh*yh);
x_comp = (int)((float)COMP_R*yh / xy_mean);
y_comp = (int)((float)COMP_R*xh / xy_mean);
/* transform to LCD coordinates */
x_lcd = x_comp + COMP_X0;
y_lcd = -y_comp + COMP_Y0;
/* we need sina and cosa to rotate compass arrow */
sina = (float)yh/xy_mean;
cosa = (float)xh/xy_mean;
}
ui_update(&evt);
}
......
......@@ -50,7 +50,7 @@ menu_list main_menu = {
"Main menu",
{
{ APP, &example_icon, { .app = &example } },
{ APP, NULL, { .app = &compass } },
{ APP, &comp_ico, { .app = &compass } },
{ SUBMENU, &settings_icon, { .submenu = &settings_menu } },
{ END, NULL, { NULL } }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment