Skip to content

Commit

Permalink
Merge pull request #28 from vladkorotnev/develop
Browse files Browse the repository at this point in the history
Release v5.5
  • Loading branch information
vladkorotnev authored Dec 13, 2024
2 parents 91fa008 + 47b7d03 commit e744ba1
Show file tree
Hide file tree
Showing 70 changed files with 11,892 additions and 870 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ More photos in [the gallery](https://pis-os.genjit.su/index.html#photos)
* [daniwellP - Nyan Cat](https://www.youtube.com/watch?v=LfKCLdPTqtM): [MIDI](helper/chimes/nyancat.mid), [MP3](docs/rec/squarecat.mp3)
* [Neru - Tokyo Teddy Bear](https://www.youtube.com/watch?v=eSI7RsjZy1E): [MIDI](helper/chimes/tokyoteddybear.mid) based on [MIDI by FDG/Danny G](https://www.youtube.com/watch?v=Y30ZyZbRCrE)
* [LamazeP - Triple Baka](https://open.spotify.com/track/2dE6zWGJXZuqvfengytVGo): [MIDI](helper/chimes/3baka.mid) based on [MIDI by FDG/Danny G](https://www.youtube.com/watch?v=HNPrwdLJC8g), [MP3](docs/rec/baka.mp3)
* [Desireless — Voyage Voyage](https://youtu.be/sM2ZhByFcDk): [MIDI](helper/chimes/voyage.mid)

## Creating your own melodies

Expand Down Expand Up @@ -238,7 +239,7 @@ An ESP32-WROVER is required, because the firmware takes up 99.8% of an OTA parti

* Keypad/D-Pad. Set feature flag `HAS_KEYPAD` and define `const keypad_definition_t HWCONF_KEYPAD` in the device definition. [Driver](src/input/keypad.cpp)
* Touch plane. E.g. a faceplate with touch sensitive arrow keys to work in place of a D-pad. Set feature flag `HAS_TOUCH_PLANE` and define `const touch_plane_definition_t HWCONF_TOUCH_PLANE` in the device definition. [Driver](src/input/touch_plane.cpp)
* *Experimental/Untested* IR Remote. Set feature flag `HAS_IR_RECEIVER` and define `const infrared_definition_t HWCONF_IR_BUTTONS` in the device definition. [Driver](src/input/infrared.cpp)
* IR Remote. Set feature flag `HAS_IR_RECEIVER` and define `const infrared_definition_t HWCONF_IR_BUTTONS` in the device definition. [Driver](src/input/infrared.cpp)

### Others

Expand Down
Binary file added data/music/042_voyage.pomf
Binary file not shown.
Binary file added data/music/043_pixel_cave.pomf
Binary file not shown.
35 changes: 35 additions & 0 deletions helper/check-size-correctly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PIO/esp32-arduino doesn't correctly calculate the binary size
# See thread for more info: https://esp32.com/viewtopic.php?f=19&t=43303&sid=b02e92b5c4d3e7c16f2c3b14b2d0edc6#p141312

Import("env")

import csv
from os.path import join, getsize

BINPATH = join("$BUILD_DIR", "${PROGNAME}.bin")

def post_program_action(source, target, env):
found=False
csvpath = env["PARTITIONS_TABLE_CSV"]
print("Using partition table:", csvpath)
with open(csvpath, 'r') as file:
reader = csv.DictReader(file)
for row in reader:
if row['# Name'] == 'app0':
app0_size = int(row['Size'].strip(), 16)
found=True
break

if not found:
raise Exception("Could not find app0 size")

fp = target[0].get_path()
sz = getsize(fp) #<- scons' getsize doesn't work when creating the file for the first time, huh!
if sz >= app0_size:
print("app0 is", app0_size, "bytes, but",fp,"is",sz,": too big!")
raise Exception("resulting binary too big")
else:
print("app0 is", app0_size, "bytes, and",fp,"is",sz,": OK")


env.AddPostAction(BINPATH, post_program_action)
Binary file added helper/chimes/pixelcave.mid
Binary file not shown.
Binary file added helper/chimes/voyage.mid
Binary file not shown.
33 changes: 0 additions & 33 deletions helper/pretty-screenshot.py

This file was deleted.

18 changes: 18 additions & 0 deletions include/app/app_host.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <views/framework.h>

class AppHost: public Composite {
public:
AppHost();
void render(FantaManipulator*) override;
void step() override;
void add_view(Renderable*, view_id_t);
void switch_to(view_id_t, transition_type_t);

protected:
bool is_in_critical_state();
bool state_wants_full_screen(view_id_t);
ViewMultiplexor * main_screen = nullptr;
ViewMultiplexor * split_screen = nullptr;
bool split_active = false;
bool main_idle = true;
};
2 changes: 2 additions & 0 deletions include/app/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AppShimMenu: public ProtoShimNavMenu {
AppShimMenu(Beeper*, NewSequencer*, Yukkuri*, AmbientLightSensor*);

void prepare() override;
void render(FantaManipulator*) override;
void step() override;

void pop_renderable(transition_type_t = TRANSITION_SLIDE_HORIZONTAL_RIGHT);
Expand All @@ -21,4 +22,5 @@ class AppShimMenu: public ProtoShimNavMenu {
Beeper * beeper;
Yukkuri * yukkuri;
TickType_t last_touch_time;
int last_width;
};
1 change: 1 addition & 0 deletions include/app/musicbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AppShimMusicbox : public WeatherChartCommon {
public:
AppShimMusicbox(NewSequencer * s);
void prepare() override;
void render(FantaManipulator*) override;
void step() override;
void cleanup() override;

Expand Down
53 changes: 53 additions & 0 deletions include/app/pixel_cave.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include <views/framework.h>
#include <sound/sequencer.h>

#if HAS(PIXEL_CAVE)
class AppPixelCave: public Renderable {
public:
AppPixelCave(NewSequencer *);
void prepare() override;
void render(FantaManipulator*) override;
void step() override;
void cleanup() override;

protected:
enum PixelCaveState {
PCGAME_TITLE,
PCGAME_GAME,
PCGAME_OVER
};

struct PxcCoord {
int16_t x;
uint16_t y;
};

NewSequencer * sequencer;
MelodySequence * melody;
PixelCaveState state;

const font_definition_t * score_font;
const font_definition_t * gui_font;
uint32_t cur_score;
uint32_t hi_score;
uint8_t framecount;

static const size_t PLAYER_TRAIL_LEN = 4;
static const int16_t PLAYER_MAX_X = 16;
PxcCoord playerPos;
int16_t player_yVel;
bool unsettled;
int crash_flash;
PxcCoord playerTrail[PLAYER_TRAIL_LEN];

fanta_buffer_t playfield_buf;
FantaManipulator * playfield;
bool pf_dirty;

void leave();
void new_game();
void render_game(FantaManipulator*, bool);
void step_game();
void player_crashed();
};
#endif
35 changes: 0 additions & 35 deletions include/console.h

This file was deleted.

4 changes: 4 additions & 0 deletions include/device_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@
#endif
#endif

#if HWCONF_DISPLAY_WIDTH_PX >= 192
#define HAS_SPLIT_SCREEN_APPHOST
#endif

#endif
7 changes: 2 additions & 5 deletions include/devices/big_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <hal/gpio_hal.h>
#include <input/keypad.h>

// #define HAS_OTAFVU
#define HAS_OTAFVU
#define HAS_OUTPUT_MD_PLASMA
#define HAS_VARYING_BRIGHTNESS
#define HAS_DISPLAY_BLANKING
Expand All @@ -12,12 +12,9 @@
#define HAS_MOTION_SENSOR
#define HAS_KEYPAD

// ↓ Looks like shite on the plasma display
// #define COMPOSABLE_NO_EVENODD // let's see how it looks

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "PIS-OS"
#define PRODUCT_VERSION "5.3"
#define PRODUCT_VERSION "5.5"

// ---- Connection to DISP BOARD ----
const gpio_num_t HWCONF_PLASMA_DATABUS_GPIOS[] = {
Expand Down
24 changes: 11 additions & 13 deletions include/devices/big_noritake.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

#include <hal/gpio_hal.h>
#include <input/keypad.h>
#include <input/infrared.h>
#include <devices/ir_remotes/all_remotes.h>

#define HAS_OUTPUT_GU312
#define HAS_KEYPAD
#define HAS_VARYING_BRIGHTNESS
#define HAS_MOTION_SENSOR
#define HAS_LIGHT_SENSOR
#define HAS_TEMP_SENSOR
#define HAS_IR_RECEIVER
#define HAS_OTAFVU

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "LongPIS-OS"
#define PRODUCT_VERSION "5.3"
#define PRODUCT_VERSION "5.5"

// ---- Connection to beeper ----
const gpio_num_t HWCONF_BEEPER_GPIO = GPIO_NUM_33;
Expand All @@ -23,6 +26,10 @@ const gpio_num_t HWCONF_MOTION_GPIO = GPIO_NUM_39;
const gpio_num_t HWCONF_LIGHTSENSE_GPIO = GPIO_NUM_36;
const gpio_num_t HWCONF_IR_RECV_GPIO = GPIO_NUM_14;

// ---- Connection to temperature sensor ----
const gpio_num_t HWCONF_I2C_SDA_GPIO = GPIO_NUM_26;
const gpio_num_t HWCONF_I2C_SCL_GPIO = GPIO_NUM_25;

// ---- Connection to display ----
const gpio_num_t HWCONF_GU312_DATABUS_GPIOS[] = {
GPIO_NUM_5,
Expand All @@ -37,7 +44,8 @@ const gpio_num_t HWCONF_GU312_DATABUS_GPIOS[] = {
const gpio_num_t HWCONF_GU312_CD_GPIO = GPIO_NUM_19;
const gpio_num_t HWCONF_GU312_WR_GPIO = GPIO_NUM_18;
const gpio_num_t HWCONF_GU312_BLANKING_GPIO = GPIO_NUM_12;
const gpio_num_t HWCONF_GU312_FEP_GPIO = GPIO_NUM_13; //<- optional, can be GPIO_NUM_NC
// Disable Vsync for the sake of smoothness, may change later
const gpio_num_t HWCONF_GU312_FEP_GPIO = GPIO_NUM_NC;//GPIO_NUM_13; //<- optional, can be GPIO_NUM_NC

#define HWCONF_DISPLAY_WIDTH_PX 192
#define HWCONF_DISPLAY_HEIGHT_PX 16
Expand All @@ -49,13 +57,3 @@ const keypad_definition_t HWCONF_KEYPAD = {
{GPIO_NUM_34, KEY_UP},
{GPIO_NUM_35, KEY_DOWN},
};

const infrared_definition_t HWCONF_IR_BUTTONS = {
{
{
.protocol = IRPROTO_RC5,
.value = 0 // dummy for test
},
KEY_UP
}
};
54 changes: 54 additions & 0 deletions include/devices/ir_remotes/all_remotes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <input/infrared.h>

// NB:

const infrared_definition_t HWCONF_IR_BUTTONS = {
/**
Optosupply OE13KIR (https://akizukidenshi.com/goodsaffix/OE13KIR.pdf)
*/
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0xA0, .value = 0x8F705FA, .key = KEY_UP}, // UP
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x00, .value = 0x8F700FF, .key = KEY_DOWN}, // DOWN
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x10, .value = 0x8F708F7, .key = KEY_LEFT}, // LEFT
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x80, .value = 0x8F701FE, .key = KEY_RIGHT}, // RIGHT
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x20, .value = 0x8F704FB, .key = KEY_HEADPAT}, // CENTER
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0xf8, .value = 0x8f71fe0, .key = KEY_SOFT_F1}, // A
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x78, .value = 0x8f71ee1, .key = KEY_SOFT_F2}, // B
{ .protocol = IRPROTO_NEC, .address = 0x10, .command = 0x58, .value = 0x8f71ae5, .key = KEY_SOFT_F3}, // C
// Top-left: TYPE=3, VALUE=0x8f78d72, ADDRESS=0x10, COMMAND=0xb1
// Top-right: TYPE=3, VALUE=0x8f7847b, ADDRESS=0x10, COMMAND=0x21
// Bottom-left: TYPE=3, VALUE=0x8f78877, ADDRESS=0x10, COMMAND=0x11
// Bottom-right: TYPE=3, VALUE=0x8f7817e, ADDRESS=0x10, COMMAND=0x81
// Power: TYPE=3, VALUE=0x8f71be4, ADDRESS=0x10, COMMAND=0xd8

/**
* ProSpec DVE (Digital Video Editor)
*/
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa0, .value = 0x417405FA, .key = KEY_UP },
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa2, .value = 0x417445BA, .key = KEY_DOWN },
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa5, .value = 0x4174A55A, .key = KEY_LEFT },
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa4, .value = 0x417425DA, .key = KEY_RIGHT },
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa1, .value = 0x4174857A, .key = KEY_HEADPAT }, // input sw
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa7, .value = 0x4174E51A, .key = KEY_SOFT_F1 }, // pwr
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa6, .value = 0x4174659A, .key = KEY_SOFT_F3 }, // frame
{ .protocol = IRPROTO_NEC, .address = 0x2e82, .command = 0xa3, .value = 0x4174C53A, .key = KEY_SOFT_F2 }, // back


/**
* UNKNOWN "LCD remote"
*/
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x1b, .value = 0x61D6D827, .key = KEY_UP },
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x1a, .value = 0x61D658A7, .key = KEY_DOWN },
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x4, .value = 0x61D620DF, .key = KEY_LEFT },
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x6, .value = 0x61D6609F, .key = KEY_RIGHT },
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x5, .value = 0x61D6A05F, .key = KEY_HEADPAT },
{ .protocol = IRPROTO_NEC, .address = 0x6b86, .command = 0x12, .value = 0x61D648B7, .key = KEY_SOFT_F2 }, // pwr

/**
* UNKNOWN "Audio Switch" SPDIF/TOSLINK 4X1 REMOTE CONTROL
*/
{ .protocol = IRPROTO_NEC, .address = 0x0, .command = 0x15, .value = 0xFFA857, .key = KEY_UP },
{ .protocol = IRPROTO_NEC, .address = 0x0, .command = 0x18, .value = 0xFF18E7, .key = KEY_DOWN },
{ .protocol = IRPROTO_NEC, .address = 0x0, .command = 0x16, .value = 0xFF6897, .key = KEY_LEFT },
{ .protocol = IRPROTO_NEC, .address = 0x0, .command = 0xd, .value = 0xFFB04F, .key = KEY_RIGHT },
{ .protocol = IRPROTO_NEC, .address = 0x0, .command = 0x45, .value = 0xFFA25D, .key = KEY_HEADPAT },
};
6 changes: 5 additions & 1 deletion include/devices/led_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

#include <hal/gpio_hal.h>
#include <input/keypad.h>
#include <input/infrared.h>
#include <devices/ir_remotes/all_remotes.h>

#define HAS_OUTPUT_AKIZUKI_K875
#define HAS_KEYPAD
#define HAS_VARYING_BRIGHTNESS
#define HAS_LIGHT_SENSOR
#define HAS_IR_RECEIVER

// Plasma Information System OS (not DOS, there's no disk in it!)
#define PRODUCT_NAME "LePIS-OS"
#define PRODUCT_VERSION "5.3"
#define PRODUCT_VERSION "5.5"

// ---- Connection to beeper ----
const gpio_num_t HWCONF_BEEPER_GPIO = GPIO_NUM_33;
Expand All @@ -34,6 +37,7 @@ const gpio_num_t HWCONF_K875_SACRIFICIAL_GPIO = GPIO_NUM_5;

// ---- Connection to light sensors ----
const gpio_num_t HWCONF_LIGHTSENSE_GPIO = GPIO_NUM_36;
const gpio_num_t HWCONF_IR_RECV_GPIO = GPIO_NUM_13;

// ---- Connection of buttons ----
const keypad_definition_t HWCONF_KEYPAD = {
Expand Down
Loading

0 comments on commit e744ba1

Please sign in to comment.