Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions builtin_apps/PyDOS/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
imp = "M"
elif implementation.name.upper() == "CIRCUITPYTHON":
if not Pydos_ui:
from supervisor import runtime, reload
from supervisor import runtime

from supervisor import reload
import storage
import microcontroller
from adafruit_argv_file import argv_filename
Expand Down Expand Up @@ -91,15 +92,25 @@ def PyDOS():
print("Starting Py-DOS... Type 'help' for help.")
if readonly:
print("Warning: Py-DOS is running in read-only mode, some commands may not work.")
if input("Press Enter to continue or 'R' to restart in read-write mode: ").upper() == 'R':
print("\nNote: You can not modify files using the CIRCUITPY drive from a")
print("connected host computer in read-write mode. After restarting,")
print("you can use the 'readonly' command in PyDOS to return to read-only mode.\n")
if input('Are you sure? (Y/N): ').upper() == 'Y':
boot_args_file = argv_filename("/boot.py")
with open(boot_args_file, "w") as f:
f.write('[false, "/code.py"]')
microcontroller.reset()
ans = 'N'
while ans[:1].upper() != "C" and ans[:1].upper() != "R":
ans = input("Press 'C' to continue or 'R' to restart in read-write mode: ")
if ans[:1].upper() == "R":
print("\nNote: You can not modify files using the CIRCUITPY drive from a")
print("connected host computer in read-write mode. After restarting,")
print("you can use the 'readonly' command in PyDOS to return to read-only mode.\n")
if input('Are you sure? (Y/N): ').upper() == 'Y':
boot_args_file = argv_filename("/boot.py")
with open(boot_args_file, "w") as f:
f.write('[false, "/code.py"]')
microcontroller.reset()
else:
break
elif ans[:1].upper() == "C":
break
else:
print("\nInvalid entry",ans[:1])


envVars["PATH"] = f'{sep};{sep}apps{sep}PyDOS;{sep}apps{sep}PyBasic'
envVars["PROMPT"] = "$P$G"
Expand Down
23 changes: 20 additions & 3 deletions src/boot_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT
import gc
import json

import board
import supervisor
Expand All @@ -12,6 +13,12 @@
import adafruit_tlv320
from audiocore import WaveFile
import audiobusio
import adafruit_pathlib as pathlib

launcher_config = {}
if pathlib.Path("launcher.conf.json").exists():
with open("launcher.conf.json", "r") as f:
launcher_config = json.load(f)

BOX_SIZE = (235, 107)
TARGET_FPS = 70
Expand All @@ -35,9 +42,19 @@
# set sample rate & bit depth
dac.configure_clocks(sample_rate=11030, bit_depth=16)

# use headphones
dac.headphone_output = True
dac.headphone_volume = -15 # dB
if "sound" in launcher_config:
if launcher_config["sound"] == "speaker":
# use speaker
dac.speaker_output = True
dac.speaker_volume = -40
else:
# use headphones
dac.headphone_output = True
dac.headphone_volume = -15 # dB
else:
# default to headphones
dac.headphone_output = True
dac.headphone_volume = -15 # dB

wave_file = open("/boot_animation/ada_fruitjam_boot_jingle.wav", "rb")
wave = WaveFile(wave_file)
Expand Down