Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DantSu committed May 3, 2024
1 parent 52f749d commit f9562f7
Show file tree
Hide file tree
Showing 15 changed files with 391 additions and 403 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###########################################################

TARGET=TelmiOS
VERSION=1.1.1
VERSION=1.2.0

###########################################################

Expand Down Expand Up @@ -142,7 +142,7 @@ release: dist
@$(ECHO) $(PRINT_RECIPE)
@rm -f "$(RELEASE_DIR)/$(RELEASE_NAME).zip" "$(RELEASE_DIR)/$(RELEASE_NAME)-update.zip"
@cd "$(DIST_DIR)" && 7z a -mtc=off "$(RELEASE_DIR)/$(RELEASE_NAME).zip" . -bsp1 -bso0
@cd "$(BUILD_DIR)" && 7z a -mtc=off -spf -tzip "$(RELEASE_DIR)/$(RELEASE_NAME)-update.zip" "autorun.inf" ".tmp_update/bin/bootScreen" ".tmp_update/bin/chargingState" ".tmp_update/bin/storyTeller" ".tmp_update/onionVersion/version.txt" ".tmp_update/res" ".tmp_update/runtime.sh" -bsp1 -bso0
@cd "$(BUILD_DIR)" && 7z a -mtc=off -spf -tzip "$(RELEASE_DIR)/$(RELEASE_NAME)-update.zip" "autorun.inf" ".tmp_update/bin/batmon" ".tmp_update/bin/bootScreen" ".tmp_update/bin/chargingState" ".tmp_update/bin/storyTeller" ".tmp_update/onionVersion/version.txt" ".tmp_update/res" ".tmp_update/runtime.sh" -bsp1 -bso0
@$(ECHO) $(PRINT_DONE)

clean:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The story teller is compatible with stories exported from [STUdio](https://githu

### Download the installation files

- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.1.1/TelmiOS_v1.1.1.zip)
- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.2.0/TelmiOS_v1.2.0.zip)

### Format your SD card as FAT32 (not exFAT!)

Expand Down Expand Up @@ -46,9 +46,9 @@ Make sure you choose: `For use with all systems and devices (FAT)`

Chrome already has a tool to format an SD card. Insert the card into your Chromebook, right-click it and click **Format Device**, make sure `FAT32` is selected under **Format** and click or tap **Erase & Format**.

### Unzip TelmiOS_v1.1.1.zip
### Unzip TelmiOS_v1.2.0.zip

Put the content of `TelmiOS_v1.1.1.zip` at the root of the SD card.
Put the content of `TelmiOS_v1.2.0.zip` at the root of the SD card.

### Power on your Miyoo

Expand Down
11 changes: 0 additions & 11 deletions src/batmon/batmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ int main(int argc, char *argv[])
else {
ticks = -1;
}

#ifdef PLATFORM_MIYOOMINI
if (is_suspended || current_percentage == 500)
batteryWarning_hide();
else if (current_percentage < warn_at &&
!config_flag_get(".noBatteryWarning"))
batteryWarning_show();
else
batteryWarning_hide();
#endif

ticks++;
sleep(1);
}
Expand Down
111 changes: 50 additions & 61 deletions src/storyTeller/app_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,82 @@
#define STORYTELLER_APP_LOCK__

#include "./time_helper.h"
#include "system/display.h"

static bool applockIsLocked = false;
static bool appLockIsLocked = false;
static bool appLockIsRecentlyUnlocked = false;
static long appLockTimer = 0;
static long appLockChangedTimer = 0;

bool applock_isLocked(void)
{
return applockIsLocked;
bool applock_isLocked(void) {
return appLockIsLocked;
}

#include "./sdl_helper.h"


static long applockTimer = 0;
static long applockTimerScreenOn = 0;

void applock_startScreenTimer(void)
{
applockTimerScreenOn = get_time();
display_setScreen(true);
bool applock_isRecentlyUnlocked(void) {
return appLockIsRecentlyUnlocked;
}

void applock_stopScreenTimer(void)
{
applockTimerScreenOn = 0;
bool applock_isLockRecentlyChanged(void) {
return appLockChangedTimer > 0;
}

void applock_endScreenTimer(void)
{
applock_stopScreenTimer();
display_setScreen(false);
bool applock_isUnlocking(void) {
return appLockTimer > 0 && appLockIsLocked;
}

void applock_startTimer(void)
{
applockTimer = get_time();
if(applockIsLocked && !display_enabled) {
applock_startScreenTimer();
#include "./app_selector.h"

void applock_startTimer(void) {
appLockTimer = get_time();
if(appLockIsLocked) {
app_lockChanged();
}
}

void applock_stopTimer(void)
{
applockTimer = 0;
void applock_stopTimer(void) {
appLockTimer = 0;
if(appLockIsLocked) {
app_lockChanged();
}
}

void applock_lock(void)
{
void applock_lock(void) {
applock_stopTimer();
applockIsLocked = true;
video_applyToVideo();
appLockIsLocked = true;
appLockChangedTimer = get_time();
app_lockChanged();
}

void applock_stopLockChangedTimer(void) {
appLockChangedTimer = 0;
appLockIsRecentlyUnlocked = false;
}

void applock_unlock(void)
{
void applock_unlock(void) {
appLockIsLocked = false;
applock_stopTimer();
applockIsLocked = false;
video_applyToVideo();
appLockIsRecentlyUnlocked = true;
appLockChangedTimer = get_time();
app_lockChanged();
}

void applock_checkLock(void)
{
void applock_checkLock(void) {
long time = get_time(), laps;

if(applockTimerScreenOn > 0) {
laps = time - applockTimerScreenOn;
if(laps > 3) {
applock_endScreenTimer();
if (appLockChangedTimer > 0) {
laps = time - appLockChangedTimer;
if (laps > 2) {
applock_stopLockChangedTimer();
app_lockChanged();
}
}

if(applockTimer == 0) {
return;
}

if(applockIsLocked && !display_enabled && applockTimerScreenOn == 0) {
applock_startScreenTimer();
}

laps = time - applockTimer;

if(laps > 2) {
if(applockIsLocked) {
applock_unlock();
} else {
applock_lock();
if(!display_enabled) {
applock_startScreenTimer();
if (appLockTimer > 0) {
laps = time - appLockTimer;
if (laps > 1) {
if (appLockIsLocked) {
applock_unlock();
} else {
applock_lock();
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/storyTeller/app_parameters.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#ifndef STORYTELLER_APP_PARAMETERS__
#define STORYTELLER_APP_PARAMETERS__

#include "utils/json.h"

static double parametersAudioVolumeStartup = 0.3;
static double parametersAudioVolumeMax = 0.6;
static double parametersScreenBrightnessStartup = 0.3;
static double parametersScreenBrightnessMax = 0.6;
static int parametersScreenOnInactivityTime = 120;
static int parametersScreenOffInactivityTime = 300;
static int parametersMusicInactivityTime = 3600;
static bool parametersStoryDisplayTiles = false;

#define APP_PARAMETERS_PATH "/mnt/SDCARD/Saves/.parameters"

Expand Down Expand Up @@ -48,6 +51,10 @@ int parameters_getMusicInactivityTime() {
return parametersMusicInactivityTime;
}

bool parameters_getStoryDisplayNine() {
return parametersStoryDisplayTiles;
}

void parameters_init(void)
{
cJSON *parameters = json_load(APP_PARAMETERS_PATH);
Expand All @@ -59,6 +66,9 @@ void parameters_init(void)
json_getInt(parameters, "screenOnInactivityTime", &parametersScreenOnInactivityTime);
json_getInt(parameters, "screenOffInactivityTime", &parametersScreenOffInactivityTime);
json_getInt(parameters, "musicInactivityTime", &parametersMusicInactivityTime);
if(!cJSON_IsNull(cJSON_GetObjectItem(parameters, "storyDisplayTiles"))) {
json_getBool(parameters, "storyDisplayTiles", &parametersStoryDisplayTiles);
}
}
}

Expand Down
Loading

0 comments on commit f9562f7

Please sign in to comment.