Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
akasaka committed Nov 18, 2024
2 parents 9020645 + 4a6cc57 commit af2012e
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 19 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ A somewhat portable relatively-stylish pixel-art clock/weather station.

![](docs/img/hero.jpg)

More photos in [the gallery](https://pis-os.genjit.su/index.html#photos)

## Available widgets

* Clock
Expand Down Expand Up @@ -115,7 +117,7 @@ A somewhat portable relatively-stylish pixel-art clock/weather station.
* [HIRO — Space Harrier](https://datadiscs.bandcamp.com/track/main-theme): [MIDI](helper/chimes/space_harrier.mid) (scale altered for 1-bit output range)
* [A-ha — Take On Me](https://www.youtube.com/watch?v=djV11Xbc914): [MIDI](helper/chimes/takeonme.mid)
* [Ennio Morricone - My Name Is Nobody](https://www.youtube.com/watch?v=srSpyXwz-MQ): [MIDI](helper/chimes/mynameisnobody.mid)
* [PPK - ResuRection (ППК - Воскрешение)](https://www.youtube.com/watch?v=KvOR2E_hZsw): [MIDI](helper/chimes/ppk.mid)
* [PPK - ResuRection (ППК - Воскрешение)](https://www.youtube.com/watch?v=KvOR2E_hZsw): [MIDI](helper/chimes/ppk.mid), [MP3](docs/rec/gagarin.mp3)
* [Owl City - Fireflies](https://www.youtube.com/watch?v=psuRGfAaju4): [MIDI](helper/chimes/fireflies.mid)
* [Ado - Odo](https://www.youtube.com/watch?v=YnSW8ian29w): [MIDI](helper/chimes/odo.mid)
* [ZUN - Legend of Hourai](https://www.youtube.com/watch?v=d2_tY7cl818): [MIDI](helper/chimes/hourai_sou1.mid) based on work by sou1
Expand Down
2 changes: 2 additions & 0 deletions data/credits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ Greetz to:
- Xavier
- Engineegor
- Atsuko & Nina
- Dancing Zombie
- NightRadio
-... and YOU!
6 changes: 3 additions & 3 deletions data/lang/ja.lang
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
"P, hPa": "気圧 hPa",

"Only Once": "一回のみ",
"Enabled": "このアラームを使用する",
"Repeat on": "繰り返し日程",
"Enabled": "アラーム",
"Repeat on": "スケジュール設定",
"Time": "時刻",
"Smart Alarm": "スマートアラーム",
"Smart margin": "スマートアラームの余裕時間(分)",
Expand All @@ -133,7 +133,7 @@

"SNOOZE": "スヌーズ",
"STOP": "アラーム停止",
"HOLD": "押し続けて",
"HOLD": "長押し",

"BB_DSCNCT": "接続されていません",
"BB_CNCT_GUIDE": "\u001A を押して接続を開始してください",
Expand Down
Binary file added docs/rec/gagarin.mp3
Binary file not shown.
6 changes: 4 additions & 2 deletions src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Console::task() {

if(xQueueReceive(hQueue, &next_line, pdMS_TO_TICKS( 500 )) == pdTRUE) {
// Output next line
if(active) {
if(active && font != nullptr && font->valid) {
FantaManipulator * m = disp->manipulate();

if(m->lock()) {
Expand Down Expand Up @@ -90,7 +90,7 @@ void Console::task() {
cursor_state = false;
}

if(cursor_enable && active) {
if(cursor_enable && active && font != nullptr && font->valid) {
cursor_state = !cursor_state;
FantaManipulator * m = disp->manipulate();
if(m->lock()) {
Expand All @@ -107,6 +107,7 @@ void Console::clear() {
}

void Console::set_cursor(bool enable) {
if(font == nullptr || !font->valid) return;
if(enable && !cursor_enable) {
cursor_state = true;
if(active) {
Expand All @@ -129,6 +130,7 @@ void Console::set_cursor(bool enable) {
}

void Console::cursor_newline(FantaManipulator * m) {
if(font == nullptr || !font->valid) return;
if(cursor_y + font->height * 2 > disp->height) {
// Next line won't fit, so scroll current content above and keep Y same
m->scroll(0, -font->height);
Expand Down
7 changes: 5 additions & 2 deletions src/graphics/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ bool load_font_from_file_handle(FILE * f, font_definition_t * dest) {
r = fread(&((uint8_t*) ranges)[total], 1, sect.size - total, f);
total += r;
}

if(total != sect.size) {
ESP_LOGE(LOG_TAG, "Underrun reading range table: expected %u bytes but got only %u", sect.size, total);
free(ranges);
return false;
}

if(sect.magic == MONOFONT_MAGIC_RANGES_DEFL) {
ESP_LOGI(LOG_TAG, "Decompressing RngZ");
ranges = (font_range_t *) decompress_emplace(ranges, sect.size, sect.real_size);
if(ranges == nullptr) return false;
dest->range_count = (sect.real_size / sizeof(font_range_t));
Expand Down Expand Up @@ -123,6 +124,7 @@ bool load_font_from_file_handle(FILE * f, font_definition_t * dest) {
uint8_t * bitmap = (uint8_t*) ps_malloc(sect.size);
if(bitmap == nullptr) {
ESP_LOGE(LOG_TAG, "OOM allocating bitmap table");
free(ranges);
return false;
}

Expand All @@ -140,6 +142,7 @@ bool load_font_from_file_handle(FILE * f, font_definition_t * dest) {
}

if(sect.magic == MONOFONT_MAGIC_BITMAP_DEFL) {
ESP_LOGI(LOG_TAG, "Decompressing BMPZ");
bitmap = (uint8_t*) decompress_emplace(bitmap, sect.size, sect.real_size);
if(bitmap == nullptr) {
free(ranges);
Expand Down Expand Up @@ -294,7 +297,6 @@ const font_definition_t * find_font(font_style_t style, font_fallback_behavior_t
// Stub, todo fallback and all
if(!fonts_loaded && !did_try_loading_font) load_fonts();
did_try_loading_font = true;
if(!fonts_loaded) return nullptr;

if(style == FONT_STYLE_UI_TEXT || style == FONT_STYLE_CLOCK_FACE_SMALL || style == FONT_STYLE_CONSOLE) {
return &keyrus0808_font;
Expand Down Expand Up @@ -419,6 +421,7 @@ void sprite_from_glyph(const font_definition_t* font, char16_t glyph, bool maske
}

unsigned int measure_string_width(const font_definition_t* f, const char* s, text_attributes_t attributes) {
if(f == nullptr || !f->valid) return 0;
unsigned int rslt = 0;
const char * tmp = s;
while(iterate_utf8(&tmp)) {
Expand Down
1 change: 1 addition & 0 deletions src/network/netmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void NetworkManager::wifi_event(WiFiEvent_t ev) {
} else {
save_current_network();
}
ESP_LOGI(LOG_TAG, "RSSI: %i dB", rssi());
break;
default:
ESP_LOGI(LOG_TAG, "Unhandled event %i", ev);
Expand Down
2 changes: 2 additions & 0 deletions src/views/weather/daily_forecast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
class DailyForecastView::Column: public Composite {
public:
Column() {
wants_clear_surface = true;

icon = new AniSpriteView();
icon->x_offset = 0;
icon->width = 16;
Expand Down
92 changes: 81 additions & 11 deletions webroot/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,81 @@
<h1>Nobody here but us chickens!</h1>
<p>This is an update server for <a href="https://github.com/vladkorotnev/plasma-clock">PIS-OS</a>.</p>
<h3>Get the latest binaries:</h3>
<ul>
<li><a href="fvudata/fs.fvu">Filesystem</a> (must be flashed alongside the newest OS!)</li>
<li><a href="fvudata/PLASMA.avu">PLASMA</a> for clock type MD16101DS</li>
<li><a href="fvudata/OLED.avu">OLED</a> for clocks with the WS0010 display based upon CPU BD V1.0</li>
<li><a href="fvudata/NORITAKE_GU112.avu">NORITAKE_GU112</a> for clocks with a 112px wide ITRON display based upon CPU BD V1.0</li>
<li><a href="fvudata/NORITAKE_GU140.avu">NORITAKE_GU140</a> for clocks with a 140px wide ITRON display based upon CPU BD V1.0</li>
<li><a href="fvudata/AKI_K875.avu">AKI_K875</a> for clocks with a 128px wide display built up of Akizuki Denshi K875 LED matrix kit</li>
</ul>
<html>
<head>
<title>PIS-OS Update Server</title>
<style type="text/css">
img {
width: 600px;
height: auto;
}
</style>
</head>
<body>
<h1>Nobody here but us chickens!</h1>
<p>This is an update server for <a href="https://github.com/vladkorotnev/plasma-clock">PIS-OS</a>.</p>
<img src="rsrc/family-photo.jpg" alt="Family Photo (2024/09)" />
<h2>Get the latest binaries:</h2>
<ul>
<li><a href="fvudata/fs.fvu">Filesystem</a> (must be flashed alongside the newest OS!)</li>
<li><a href="fvudata/PLASMA.avu">PLASMA</a> for clock type MD16101DS</li>
<li><a href="fvudata/OLED.avu">OLED</a> for clocks with the WS0010 display based upon CPU BD V1.0</li>
<li><a href="fvudata/NORITAKE_GU112.avu">NORITAKE_GU112</a> for clocks with a 112px wide ITRON display based upon CPU BD V1.0</li>
<li><a href="fvudata/NORITAKE_GU140.avu">NORITAKE_GU140</a> for clocks with a 140px wide ITRON display based upon CPU BD V1.0</li>
<li><a href="fvudata/AKI_K875.avu">AKI_K875</a> for clocks with a 128px wide display built up of Akizuki Denshi K875 LED matrix kit</li>
</ul>
<hr />
<a name="photos"></a>
<h2>Photo Gallery</h2>
<h4>PLASMA</h4>
<p>build by akasaka, Apr 2024. Done on multiple breadboards with magnet wire. The original Orange Ticking Thing. Features: Plasma display (Morio Denki MD16101), motion sensor, light sensor.</p>
<img src="rsrc/plasma.jpg" />
<iframe width="560" height="315" src="https://www.youtube.com/embed/D4MiHmhhjeQ?si=5r3CRCdFREg4hbOS" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<p>WIP photos:</p>
<img src="rsrc/plasma-wip.jpg" />
<img src="rsrc/plasma-wip2.jpg" />
<h4>NORITAKE_GU112</h4>
<p>build by akasaka, Oct 2024. Uses uPIS-OS PCB rev1.0. Features: VFD display (112x16-GU7000), vibration speaker (Taptic Engine), motion sensor, light sensor, headpat.</p>
<img src="rsrc/gu112-1.jpg" />
<img src="rsrc/gu112-2.jpg" />
<img src="rsrc/gu112-3.jpg" />
<h4>NORITAKE_GU140</h4>
<p>build by akasaka, Oct 2024. Main development machine, based around PCB rev1.0. Features: VFD display (140x16-GU7000), audio output port, motion sensor, light sensor, headpat.</p>
<img src="rsrc/gu140.jpg" />
<h4>AKI_K875</h4>
<p>build by akasaka, Nov 2024. Based around PCB rev1.0. Features: LED display using shift registers, big sperker, light sensor.</p>
<img src="rsrc/aki-1.jpg" />
<img src="rsrc/aki-2.jpg" />
<iframe width="560" height="315" src="https://www.youtube.com/embed/4sID_2LK8-w?si=NMj1jICq6d6z5cce" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<h4>DEVICE_MICROPISOS</h4>
<p>build by akasaka, Jul 2024. Breadboard + magnet wire. Features: OLED display (WS0010), audio output port, touchscreen (4 zones). Dismantled in Sep 2024.</p>
<img src="rsrc/micropisos.jpg" />
<iframe width="560" height="315" src="https://www.youtube.com/embed/Kn7ZN_xONCQ?si=BfsuYNZ3EWhcnEwt" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/FE-4xm7QFkQ?si=pHjOYdzPCwXkMBBb" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<h4>OLED</h4>
<p>build by akasaka, Sep-Nov 2024, total of 4 units. Identical to the NORITAKE_GU112 above, but uses a cheaper WS0010 OLED display instead.</p>
<img src="rsrc/oled-1.jpg" />
<img src="rsrc/oled-2.jpg" />
<img src="rsrc/oled-3.jpg" />
<hr />
<h2>Project Credits</h2>
<ul>
<li>Icons by <a target="_blank" href="https://piixl.itch.io">PiiXL</a>, weather animations done by akasaka</li>
<li>Voice module (optional) AquesTalk by <a target="_blank" href="http://www.a-quest.com">A-QUEST</a></li>
<li>Ringtones arranged for beeper and 1-bit poly by <a target="_blank" href="https://twitter.com/akasaka_spk">DJ AKASAKA</a> with some help from <a target="_blank" href="https://www.fiverr.com/lemuel_producer">lemuel_producer</a> (in Antenna 39, Shabon, En Elmegyek)</li>
<li>keyrus0808, keyrus0816 fonts &copy; Dmitriy Gurtyak 1989-1994</li>
<li>XNU Console Font &copy; 2000 Apple Computer, Inc. &amp; Ka-Ping Yee</li>
<li>Misaki Mincho Font by <a href="https://littlelimit.net/misaki.htm" target="_blank">LittleLimit</a></li>
<li>JISKAN16 font from Public Domain (JIS X 9051-1984)</li>
</ul>
<h2>Project GREETZ!</h2>
<ul>
<li>PASHA & co. from VENUS</li>
<li>Akito from DENSETOS</li>
<li>Kirill from PAW NOIR</li>
<li>Xavier</li>
<li>Atsuko &amp; Nina</li>
<li>Dancing Zombie</li>
<li><a href="http://warmplace.ru" target="_blank">NightRadio</a></li>
<li>... and YOU the users!</li>
</ul>
<em>&copy; 2024 / a <a href="https://genjit.su">Genjitsu Gadget Lab</a> product</em>
</body>
</html>
Binary file added webroot/rsrc/aki-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/aki-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/family-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/gu112-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/gu112-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/gu112-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/gu140.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/micropisos.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/oled-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/oled-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/oled-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/plasma-wip.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/plasma-wip2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webroot/rsrc/plasma.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit af2012e

Please sign in to comment.