commit
cb2216176c
@ -1,129 +1,225 @@
|
||||
/* Copyright (C) 2020 JF, Adam Pigg, Avamander
|
||||
|
||||
This file is part of InfiniTime.
|
||||
|
||||
InfiniTime is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
InfiniTime is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <systemtask/SystemTask.h>
|
||||
#include "MusicService.h"
|
||||
|
||||
int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) {
|
||||
auto musicService = static_cast<Pinetime::Controllers::MusicService*>(arg);
|
||||
auto musicService = static_cast<Pinetime::Controllers::MusicService *>(arg);
|
||||
return musicService->OnCommand(conn_handle, attr_handle, ctxt);
|
||||
}
|
||||
|
||||
Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask &system) : m_system(system)
|
||||
{
|
||||
msUuid.value[11] = msId[0];
|
||||
msUuid.value[12] = msId[1];
|
||||
msEventCharUuid.value[11] = msEventCharId[0];
|
||||
msEventCharUuid.value[12] = msEventCharId[1];
|
||||
msStatusCharUuid.value[11] = msStatusCharId[0];
|
||||
msStatusCharUuid.value[12] = msStatusCharId[1];
|
||||
msTrackCharUuid.value[11] = msTrackCharId[0];
|
||||
msTrackCharUuid.value[12] = msTrackCharId[1];
|
||||
msArtistCharUuid.value[11] = msArtistCharId[0];
|
||||
msArtistCharUuid.value[12] = msArtistCharId[1];
|
||||
msAlbumCharUuid.value[11] = msAlbumCharId[0];
|
||||
msAlbumCharUuid.value[12] = msAlbumCharId[1];
|
||||
|
||||
characteristicDefinition[0] = { .uuid = (ble_uuid_t*)(&msEventCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_NOTIFY,
|
||||
.val_handle = &m_eventHandle
|
||||
};
|
||||
characteristicDefinition[1] = { .uuid = (ble_uuid_t*)(&msStatusCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[2] = { .uuid = (ble_uuid_t*)(&msTrackCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[3] = { .uuid = (ble_uuid_t*)(&msArtistCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[4] = { .uuid = (ble_uuid_t*)(&msAlbumCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[5] = {0};
|
||||
|
||||
serviceDefinition[0] = {
|
||||
.type = BLE_GATT_SVC_TYPE_PRIMARY,
|
||||
.uuid = (ble_uuid_t *) &msUuid,
|
||||
.characteristics = characteristicDefinition
|
||||
};
|
||||
serviceDefinition[1] = {0};
|
||||
|
||||
m_artist = "Waiting for";
|
||||
m_album = "";
|
||||
m_track = "track information...";
|
||||
Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask &system) : m_system(system) {
|
||||
msUuid.value[11] = msId[0];
|
||||
msUuid.value[12] = msId[1];
|
||||
msEventCharUuid.value[11] = msEventCharId[0];
|
||||
msEventCharUuid.value[12] = msEventCharId[1];
|
||||
msStatusCharUuid.value[11] = msStatusCharId[0];
|
||||
msStatusCharUuid.value[12] = msStatusCharId[1];
|
||||
msTrackCharUuid.value[11] = msTrackCharId[0];
|
||||
msTrackCharUuid.value[12] = msTrackCharId[1];
|
||||
msArtistCharUuid.value[11] = msArtistCharId[0];
|
||||
msArtistCharUuid.value[12] = msArtistCharId[1];
|
||||
msAlbumCharUuid.value[11] = msAlbumCharId[0];
|
||||
msAlbumCharUuid.value[12] = msAlbumCharId[1];
|
||||
msPositionCharUuid.value[11] = msPositionCharId[0];
|
||||
msPositionCharUuid.value[12] = msPositionCharId[1];
|
||||
msTotalLengthCharUuid.value[11] = msTotalLengthCharId[0];
|
||||
msTotalLengthCharUuid.value[12] = msTotalLengthCharId[1];
|
||||
msTrackNumberCharUuid.value[11] = msTrackNumberCharId[0];
|
||||
msTrackNumberCharUuid.value[12] = msTrackNumberCharId[1];
|
||||
msTrackTotalCharUuid.value[11] = msTrackTotalCharId[0];
|
||||
msTrackTotalCharUuid.value[12] = msTrackTotalCharId[1];
|
||||
msPlaybackSpeedCharUuid.value[11] = msPlaybackSpeedCharId[0];
|
||||
msPlaybackSpeedCharUuid.value[12] = msPlaybackSpeedCharId[1];
|
||||
msRepeatCharUuid.value[11] = msRepeatCharId[0];
|
||||
msRepeatCharUuid.value[12] = msRepeatCharId[1];
|
||||
msShuffleCharUuid.value[11] = msShuffleCharId[0];
|
||||
msShuffleCharUuid.value[12] = msShuffleCharId[1];
|
||||
|
||||
characteristicDefinition[0] = {.uuid = (ble_uuid_t *) (&msEventCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_NOTIFY,
|
||||
.val_handle = &eventHandle
|
||||
};
|
||||
characteristicDefinition[1] = {.uuid = (ble_uuid_t *) (&msStatusCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[2] = {.uuid = (ble_uuid_t *) (&msTrackCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[3] = {.uuid = (ble_uuid_t *) (&msArtistCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[4] = {.uuid = (ble_uuid_t *) (&msAlbumCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[5] = {.uuid = (ble_uuid_t *) (&msPositionCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[6] = {.uuid = (ble_uuid_t *) (&msTotalLengthCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[7] = {.uuid = (ble_uuid_t *) (&msTotalLengthCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[8] = {.uuid = (ble_uuid_t *) (&msTrackNumberCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[9] = {.uuid = (ble_uuid_t *) (&msTrackTotalCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[10] = {.uuid = (ble_uuid_t *) (&msPlaybackSpeedCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[11] = {.uuid = (ble_uuid_t *) (&msRepeatCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[12] = {.uuid = (ble_uuid_t *) (&msShuffleCharUuid),
|
||||
.access_cb = MSCallback,
|
||||
.arg = this,
|
||||
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ
|
||||
};
|
||||
characteristicDefinition[13] = {0};
|
||||
|
||||
serviceDefinition[0] = {
|
||||
.type = BLE_GATT_SVC_TYPE_PRIMARY,
|
||||
.uuid = (ble_uuid_t *) &msUuid,
|
||||
.characteristics = characteristicDefinition
|
||||
};
|
||||
serviceDefinition[1] = {0};
|
||||
|
||||
artistName = "Waiting for";
|
||||
albumName = "";
|
||||
trackName = "track information...";
|
||||
playing = false;
|
||||
repeat = false;
|
||||
shuffle = false;
|
||||
playbackSpeed = 1.0f;
|
||||
trackProgress = 0;
|
||||
trackLength = 0;
|
||||
}
|
||||
|
||||
void Pinetime::Controllers::MusicService::Init()
|
||||
{
|
||||
void Pinetime::Controllers::MusicService::Init() {
|
||||
int res = 0;
|
||||
res = ble_gatts_count_cfg(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
|
||||
|
||||
res = ble_gatts_add_svcs(serviceDefinition);
|
||||
ASSERT(res == 0);
|
||||
}
|
||||
|
||||
int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_t attr_handle,
|
||||
struct ble_gatt_access_ctxt *ctxt) {
|
||||
|
||||
struct ble_gatt_access_ctxt *ctxt) {
|
||||
|
||||
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
|
||||
size_t notifSize = OS_MBUF_PKTLEN(ctxt->om);
|
||||
uint8_t data[notifSize + 1];
|
||||
data[notifSize] = '\0';
|
||||
os_mbuf_copydata(ctxt->om, 0, notifSize, data);
|
||||
char *s = (char *) &data[0];
|
||||
NRF_LOG_INFO("DATA : %s", s);
|
||||
if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msArtistCharUuid) == 0) {
|
||||
m_artist = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msTrackCharUuid) == 0) {
|
||||
m_track = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msAlbumCharUuid) == 0) {
|
||||
m_album = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *)&msStatusCharUuid) == 0) {
|
||||
m_status = s[0];
|
||||
}
|
||||
size_t notifSize = OS_MBUF_PKTLEN(ctxt->om);
|
||||
uint8_t data[notifSize + 1];
|
||||
data[notifSize] = '\0';
|
||||
os_mbuf_copydata(ctxt->om, 0, notifSize, data);
|
||||
char *s = (char *) &data[0];
|
||||
NRF_LOG_INFO("DATA : %s", s);
|
||||
if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msArtistCharUuid) == 0) {
|
||||
artistName = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msTrackCharUuid) == 0) {
|
||||
trackName = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msAlbumCharUuid) == 0) {
|
||||
albumName = s;
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msStatusCharUuid) == 0) {
|
||||
playing = s[0];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msRepeatCharUuid) == 0) {
|
||||
repeat = s[0];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msShuffleCharUuid) == 0) {
|
||||
shuffle = s[0];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msPositionCharUuid) == 0) {
|
||||
trackProgress = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msTotalLengthCharUuid) == 0) {
|
||||
trackLength = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msTrackNumberCharUuid) == 0) {
|
||||
trackNumber = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msTrackTotalCharUuid) == 0) {
|
||||
tracksTotal = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
|
||||
} else if (ble_uuid_cmp(ctxt->chr->uuid, (ble_uuid_t *) &msPlaybackSpeedCharUuid) == 0) {
|
||||
playbackSpeed = static_cast<float>(((s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3])) / 100.0f;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string Pinetime::Controllers::MusicService::album()
|
||||
{
|
||||
return m_album;
|
||||
std::string Pinetime::Controllers::MusicService::getAlbum() {
|
||||
return albumName;
|
||||
}
|
||||
|
||||
std::string Pinetime::Controllers::MusicService::artist()
|
||||
{
|
||||
return m_artist;
|
||||
std::string Pinetime::Controllers::MusicService::getArtist() {
|
||||
return artistName;
|
||||
}
|
||||
|
||||
std::string Pinetime::Controllers::MusicService::track()
|
||||
{
|
||||
return m_track;
|
||||
std::string Pinetime::Controllers::MusicService::getTrack() {
|
||||
return trackName;
|
||||
}
|
||||
|
||||
unsigned char Pinetime::Controllers::MusicService::status()
|
||||
{
|
||||
return m_status;
|
||||
bool Pinetime::Controllers::MusicService::isPlaying() {
|
||||
return playing;
|
||||
}
|
||||
|
||||
void Pinetime::Controllers::MusicService::event(char event)
|
||||
{
|
||||
auto *om = ble_hs_mbuf_from_flat(&event, 1);
|
||||
|
||||
uint16_t connectionHandle = m_system.nimble().connHandle();
|
||||
|
||||
if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
ble_gattc_notify_custom(connectionHandle, m_eventHandle, om);
|
||||
float Pinetime::Controllers::MusicService::getPlaybackSpeed() {
|
||||
return playbackSpeed;
|
||||
}
|
||||
|
||||
void Pinetime::Controllers::MusicService::event(char event) {
|
||||
auto *om = ble_hs_mbuf_from_flat(&event, 1);
|
||||
|
||||
uint16_t connectionHandle = m_system.nimble().connHandle();
|
||||
|
||||
if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
ble_gattc_notify_custom(connectionHandle, eventHandle, om);
|
||||
}
|
||||
|
||||
int Pinetime::Controllers::MusicService::getProgress() {
|
||||
return trackProgress;
|
||||
}
|
||||
|
||||
int Pinetime::Controllers::MusicService::getTrackLength() {
|
||||
return trackLength;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,110 @@
|
||||
/* Copyright (C) 2020 Avamander
|
||||
|
||||
This file is part of InfiniTime.
|
||||
|
||||
InfiniTime is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
InfiniTime is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
#ifndef LV_ATTRIBUTE_IMG_DISC
|
||||
#define LV_ATTRIBUTE_IMG_DISC
|
||||
#endif
|
||||
|
||||
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_DISC uint8_t disc_map[] = {
|
||||
0xbd, 0xc1, 0xbe, 0xff, /* Color of index 0: foreground */
|
||||
0x00, 0x00, 0x00, 0x00, /* Color of index 1: background */
|
||||
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0x0f, 0xf8, 0x07, 0xff, 0xff,
|
||||
0xff, 0xff, 0xc0, 0xff, 0xff, 0x81, 0xff, 0xff,
|
||||
0xff, 0xff, 0x07, 0xff, 0xff, 0xf0, 0x7f, 0xff,
|
||||
0xff, 0xfc, 0x1f, 0xff, 0xff, 0xfc, 0x1f, 0xff,
|
||||
0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0x0f, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff,
|
||||
0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff,
|
||||
0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff,
|
||||
0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff,
|
||||
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f,
|
||||
0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f,
|
||||
0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f,
|
||||
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf,
|
||||
0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7,
|
||||
0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7,
|
||||
0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3,
|
||||
0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3,
|
||||
0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1,
|
||||
0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9,
|
||||
0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
|
||||
0x8f, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xf8,
|
||||
0x9f, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe3, 0xe3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe7, 0xf3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe7, 0xf3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe7, 0xf3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe7, 0xf3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe7, 0xf3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xe3, 0xe3, 0xff, 0xff, 0xfc,
|
||||
0x9f, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xfc,
|
||||
0x8f, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xf8,
|
||||
0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9,
|
||||
0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1,
|
||||
0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1,
|
||||
0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3,
|
||||
0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3,
|
||||
0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7,
|
||||
0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7,
|
||||
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf,
|
||||
0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f,
|
||||
0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f,
|
||||
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f,
|
||||
0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff,
|
||||
0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff,
|
||||
0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff,
|
||||
0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0x0f, 0xff,
|
||||
0xff, 0xfc, 0x1f, 0xff, 0xff, 0xfc, 0x1f, 0xff,
|
||||
0xff, 0xff, 0x07, 0xff, 0xff, 0xf0, 0x7f, 0xff,
|
||||
0xff, 0xff, 0xc0, 0xff, 0xff, 0x81, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0x0f, 0xf8, 0x07, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff,
|
||||
};
|
||||
|
||||
const lv_img_dsc_t disc = {
|
||||
{
|
||||
LV_IMG_CF_INDEXED_1BIT,
|
||||
0,
|
||||
0,
|
||||
64,
|
||||
64
|
||||
},
|
||||
520,
|
||||
disc_map
|
||||
};
|
Binary file not shown.
After Width: | Height: | Size: 516 B |
@ -0,0 +1,79 @@
|
||||
/* Copyright (C) 2020 Avamander
|
||||
|
||||
This file is part of InfiniTime.
|
||||
|
||||
InfiniTime is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
InfiniTime is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
#ifndef LV_ATTRIBUTE_IMG_DISC_F_1
|
||||
#define LV_ATTRIBUTE_IMG_DISC_F_1
|
||||
#endif
|
||||
|
||||
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_DISC_F_1 uint8_t disc_f_1_map[] = {
|
||||
0xbd, 0xc1, 0xbe, 0xff, /* Color of index 0: foreground */
|
||||
0x00, 0x00, 0x00, 0x00, /* Color of index 1: background */
|
||||
|
||||
0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xc0,
|
||||
0xff, 0xff, 0xfc, 0x00,
|
||||
0xff, 0xff, 0xf0, 0x0f,
|
||||
0xff, 0xff, 0xc0, 0xff,
|
||||
0xff, 0xff, 0x07, 0xff,
|
||||
0xff, 0xfc, 0x1f, 0xff,
|
||||
0xff, 0xf8, 0x7f, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xe3, 0xff, 0xff,
|
||||
0xff, 0xc7, 0xf3, 0xff,
|
||||
0xff, 0x8f, 0xc3, 0xff,
|
||||
0xff, 0x1f, 0x87, 0xff,
|
||||
0xfe, 0x3f, 0x0f, 0xff,
|
||||
0xfc, 0x7e, 0x1f, 0xff,
|
||||
0xfc, 0x7c, 0x3f, 0xff,
|
||||
0xf8, 0xfc, 0x7f, 0xff,
|
||||
0xf9, 0xfc, 0xff, 0xff,
|
||||
0xf1, 0xff, 0xff, 0xff,
|
||||
0xf3, 0xff, 0xff, 0xff,
|
||||
0xe3, 0xff, 0xff, 0xff,
|
||||
0xe7, 0xff, 0xff, 0xff,
|
||||
0xc7, 0xff, 0xff, 0xff,
|
||||
0xc7, 0xff, 0xff, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xf8,
|
||||
0x9f, 0xff, 0xff, 0xf0,
|
||||
0x9f, 0xff, 0xff, 0xe3,
|
||||
0x9f, 0xff, 0xff, 0xe7,
|
||||
0x9f, 0xff, 0xff, 0xe7,
|
||||
};
|
||||
|
||||
const lv_img_dsc_t disc_f_1 = {
|
||||
{
|
||||
LV_IMG_CF_INDEXED_1BIT,
|
||||
0,
|
||||
0,
|
||||
32,
|
||||
32
|
||||
},
|
||||
136,
|
||||
disc_f_1_map
|
||||
};
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 200 B |
@ -0,0 +1,79 @@
|
||||
/* Copyright (C) 2020 Avamander
|
||||
|
||||
This file is part of InfiniTime.
|
||||
|
||||
InfiniTime is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
InfiniTime is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
#ifndef LV_ATTRIBUTE_IMG_DISC_F_2
|
||||
#define LV_ATTRIBUTE_IMG_DISC_F_2
|
||||
#endif
|
||||
|
||||
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_DISC_F_2 uint8_t disc_f_2_map[] = {
|
||||
0xbd, 0xc1, 0xbe, 0xff, /* Color of index 0: foreground */
|
||||
0x00, 0x00, 0x00, 0x00, /* Color of index 1: background */
|
||||
|
||||
0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xc0,
|
||||
0xff, 0xff, 0xfc, 0x00,
|
||||
0xff, 0xff, 0xf0, 0x0f,
|
||||
0xff, 0xff, 0xc0, 0xff,
|
||||
0xff, 0xff, 0x07, 0xff,
|
||||
0xff, 0xfc, 0x1f, 0xff,
|
||||
0xff, 0xf8, 0x7f, 0xf1,
|
||||
0xff, 0xf0, 0xff, 0x00,
|
||||
0xff, 0xe3, 0xfc, 0x03,
|
||||
0xff, 0xc7, 0xf0, 0x3f,
|
||||
0xff, 0x8f, 0xf0, 0xff,
|
||||
0xff, 0x1f, 0xf3, 0xff,
|
||||
0xfe, 0x3f, 0xff, 0xff,
|
||||
0xfc, 0x7f, 0xff, 0xff,
|
||||
0xfc, 0x7f, 0xff, 0xff,
|
||||
0xf8, 0xff, 0xff, 0xff,
|
||||
0xf9, 0xff, 0xff, 0xff,
|
||||
0xf1, 0xff, 0xff, 0xff,
|
||||
0xf3, 0xff, 0xff, 0xff,
|
||||
0xe3, 0xff, 0xff, 0xff,
|
||||
0xe7, 0xff, 0xff, 0xff,
|
||||
0xc7, 0xff, 0xff, 0xff,
|
||||
0xc7, 0xff, 0xff, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xf8,
|
||||
0x9f, 0xff, 0xff, 0xf0,
|
||||
0x9f, 0xff, 0xff, 0xe3,
|
||||
0x9f, 0xff, 0xff, 0xe7,
|
||||
0x9f, 0xff, 0xff, 0xe7,
|
||||
};
|
||||
|
||||
const lv_img_dsc_t disc_f_2 = {
|
||||
{
|
||||
LV_IMG_CF_INDEXED_1BIT,
|
||||
0,
|
||||
0,
|
||||
32,
|
||||
32
|
||||
},
|
||||
136,
|
||||
disc_f_2_map
|
||||
};
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 197 B |
Loading…
Reference in New Issue