Skip to content

Commit

Permalink
cleaning up builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Jan 2, 2025
1 parent ee202a2 commit 41c132a
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 217 deletions.
3 changes: 3 additions & 0 deletions tulip/amyboard/boards/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")
freeze("$(MPY_DIR)/../amy", "amy_wave.py")
freeze("$(MPY_DIR)/../amy/experiments", "tulip_piano.py")
freeze("$(MPY_DIR)/../amy/experiments", "piano_params.py")

#freeze("$(MPY_DIR)/lib/micropython-lib/micropython/utarfile", "utarfile.py")
187 changes: 1 addition & 186 deletions tulip/amyboard/pins.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
// pins.h
// pins (and other MCU constants) for all Tulip variants
// pins (and other MCU constants)

#define BK_LIGHT_ON_LEVEL 1
#ifndef DEFAULT_BRIGHTNESS
#define DEFAULT_BRIGHTNESS 9 // 9 is max, 1 is min
#endif
#define BK_LIGHT_OFF_LEVEL !BK_LIGHT_ON_LEVEL
#define SPI_LL_DATA_MAX_BIT_LEN (1 << 18)

#ifdef TDECK
#define TDECK_PERI_GPIO 10
#define TDECK_LCD_BK_LIGHT_GPIO 42
#define TDECK_LCD_RST_GPIO -1
#define TDECK_LCD_CS_GPIO 12
#define TDECK_LCD_DC_GPIO 11
#define TDECK_LCD_PCLK_GPIO 40
#define TDECK_LCD_MOSI_GPIO 41 // MOSI
#define TDECK_LCD_MISO_GPIO 38 // MISO
#define TDECK_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000)
#define TDECK_SPI_HOST_ID SPI2_HOST
#define TDECK_POWERON 10
#define TDECK_I2C_SDA 18
#define TDECK_I2C_SCL 8
#define LILYGO_KB_SLAVE_ADDRESS 0x55
#define TDECK_TOUCH_ADDR_0 0x14
#define TDECK_TOUCH_ADDR_1 0x5D
#define TDECK_TRACKBALL_UP 3
#define TDECK_TRACKBALL_DOWN 15
#define TDECK_TRACKBALL_LEFT 1
#define TDECK_TRACKBALL_RIGHT 2
#define TDECK_TRACKBALL_CLICK 0
#define TOUCH_INT 16
#define I2C_SCL 8
#define I2C_SDA 18
Expand All @@ -43,170 +16,12 @@
#define CONFIG_I2S_NUM 0
#define MIDI_OUT_PIN UART_PIN_NO_CHANGE
#define MIDI_IN_PIN UART_PIN_NO_CHANGE
#endif

// Tulip4R10, V0, MaTouch7
#ifdef MAKERFABS
#define I2C_SDA 17
#define I2C_SCL 18
#define TOUCH_INT -1
#define I2C_NUM I2C_NUM_0
#define I2C_CLK_FREQ 100000
#define DEFAULT_BRIGHTNESS 9 // 9 is max, 1 is min
#define HSYNC_BACK_PORCH 16
#define HSYNC_FRONT_PORCH 210
#define HSYNC_PULSE_WIDTH 30
#define VSYNC_BACK_PORCH 10
#define VSYNC_FRONT_PORCH 22
#define VSYNC_PULSE_WIDTH 13
#define PIN_NUM_HSYNC 39
#define PIN_NUM_VSYNC 41
#define PIN_NUM_DE 40
#define PIN_NUM_PCLK 42

#ifdef MATOUCH7
#define TOUCH_RST 38
#define PIN_NUM_BK_PWM 10
#define PIN_R7 14
#define PIN_R6 21
#define PIN_R5 47
#define PIN_R4 48
#define PIN_R3 45
#define PIN_G7 4
#define PIN_G6 16
#define PIN_G5 15
#define PIN_G4 7
#define PIN_G3 6
#define PIN_G2 5
#define PIN_B7 1
#define PIN_B6 9
#define PIN_B5 46
#define PIN_B4 3
#define PIN_B3 8
#define ESP_INTR_FLAG_DEFAULT 0

// This assumes you've used a SD card adapter to get I2s audio
#define CONFIG_I2S_LRCLK 13 //2
#define CONFIG_I2S_BCLK 12 //20
#define CONFIG_I2S_DIN 11 //19
#define CONFIG_I2S_NUM 0

// No MIDI on Matouch7
#define MIDI_OUT_PIN UART_PIN_NO_CHANGE
#define MIDI_IN_PIN UART_PIN_NO_CHANGE

#elif defined TULIP4_R11
#define TOUCH_RST 48
#define PIN_NUM_BK_PWM 47
#define PIN_R7 14
#define PIN_R6 21
#define PIN_R5 10
#define PIN_R4 13
#define PIN_R3 45
#define PIN_G7 4
#define PIN_G6 16
#define PIN_G5 15
#define PIN_G4 7
#define PIN_G3 6
#define PIN_G2 -1
#define PIN_B7 1
#define PIN_B6 9
#define PIN_B5 46
#define PIN_B4 38
#define PIN_B3 -1
#define ESP_INTR_FLAG_DEFAULT 0
#define CONFIG_I2S_LRCLK 2
#define CONFIG_I2S_BCLK 8
#define CONFIG_I2S_DIN 5
#define CONFIG_I2S_NUM 0
#define MIDI_OUT_PIN 11
#define MIDI_IN_PIN 12

#elif defined TULIP4_R10_V0
#define TOUCH_RST 48
#define PIN_NUM_BK_PWM 47
#define PIN_R7 14
#define PIN_R6 21
#define PIN_R5 10
#define PIN_R4 13
#define PIN_R3 45
#define PIN_G7 4
#define PIN_G6 16
#define PIN_G5 15
#define PIN_G4 7
#define PIN_G3 6
#define PIN_G2 5
#define PIN_B7 1
#define PIN_B6 9
#define PIN_B5 46
#define PIN_B4 38
#define PIN_B3 8
#define ESP_INTR_FLAG_DEFAULT 0
#define CONFIG_I2S_LRCLK 2

// Note, r10 v0 shares I2S pins with USB on accident
#define CONFIG_I2S_BCLK 20
#define CONFIG_I2S_DIN 19
#define CONFIG_I2S_NUM 0
#define MIDI_OUT_PIN 11
#define MIDI_IN_PIN 12
#endif

#define PIN_NUM_DISP_EN -1
#endif // MAKERFABS



#ifdef TULIP_DIY
#define I2C_SCL 17
#define I2C_SDA 18
#define TOUCH_INT (5)
#define TOUCH_INT_IO_MUX (PERIPHS_IO_MUX_GPIO5_U)
#define I2C_NUM I2C_NUM_0
#define TOUCH_RST -1
#define I2C_CLK_FREQ 400000
#define HSYNC_BACK_PORCH 139
#define HSYNC_FRONT_PORCH 140
#define HSYNC_PULSE_WIDTH 20
#define VSYNC_BACK_PORCH 20
#define VSYNC_FRONT_PORCH 12
#define VSYNC_PULSE_WIDTH 20
#define PIN_NUM_BK_LIGHT 39 // was 19, was 14 white
#define PIN_NUM_HSYNC 40
#define PIN_NUM_VSYNC 41
#define PIN_NUM_DE 42
#define PIN_NUM_PCLK 14 // was 38, was 20, was 13 black
#define PIN_NUM_BK_PWM 16

#define PIN_R7 15
#define PIN_R6 7
#define PIN_R5 6
#define PIN_R4 -1 // NC
#define PIN_R3 -1 // NC

#define PIN_G7 46
#define PIN_G6 3
#define PIN_G5 8
#define PIN_G4 -1 // NC
#define PIN_G3 -1 // NC
#define PIN_G2 -1 // NC

#define PIN_B7 21
#define PIN_B6 12
#define PIN_B5 -1 // NC
#define PIN_B4 -1 // NC
#define PIN_B3 -1 // NC

#define PIN_NUM_DISP_EN -1
#define ESP_INTR_FLAG_DEFAULT 0
#define CONFIG_I2S_LRCLK 4
#define CONFIG_I2S_BCLK 1
#define CONFIG_I2S_DIN 2
#define CONFIG_I2S_NUM 0
#define MIDI_OUT_PIN 11
#define MIDI_IN_PIN 47
#endif




Expand Down
2 changes: 2 additions & 0 deletions tulip/esp32s3/boards/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")
freeze("$(MPY_DIR)/../amy", "amy_wave.py")
freeze("$(MPY_DIR)/../amy/experiments", "tulip_piano.py")
freeze("$(MPY_DIR)/../amy/experiments", "piano_params.py")
#freeze("$(MPY_DIR)/lib/micropython-lib/micropython/utarfile", "utarfile.py")
3 changes: 2 additions & 1 deletion tulip/esp32s3/esp32_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ idf_component_register(
${MICROPY_INC_TINYUSB}
../../tulip/shared
../../amy/src
../../tulip/ulab/code
../../tulip/shared/ulab/code
${LV_BINDING_DIR}
${LVGL_DIR}/src
REQUIRES
Expand Down Expand Up @@ -367,6 +367,7 @@ target_compile_options(${MICROPY_TARGET} PUBLIC
-fsingle-precision-constant
-Wno-strict-aliasing
-DESP_PLATFORM
-DAMY_HAS_AUDIO_IN
-DSTATIC=static
-DLFS2_NO_DEBUG
)
Expand Down
2 changes: 1 addition & 1 deletion tulip/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ INC += -I$(BUILD)
CWARN = -Wall -Werror
CWARN += -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-old-style-declaration -Wno-unused-but-set-parameter -Wpointer-arith -Wdouble-promotion -Wno-float-conversion -Wno-missing-declarations -Wno-unused-but-set-variable -Wno-sign-compare -Wno-gnu-variable-sized-type-not-at-end -Wno-undefined-internal
CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA)
CFLAGS += -DTULIP_DESKTOP
CFLAGS += -DTULIP_DESKTOP -DAMY_HAS_AUDIO_IN
CFLAGS += $(ARCHFLAGS)

# Debugging/Optimization
Expand Down
2 changes: 2 additions & 0 deletions tulip/linux/variants/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")
freeze("$(MPY_DIR)/../amy", "amy_wave.py")
freeze("$(MPY_DIR)/../amy/experiments", "tulip_piano.py")
freeze("$(MPY_DIR)/../amy/experiments", "piano_params.py")

2 changes: 1 addition & 1 deletion tulip/macos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ INC += -I$(BUILD)
CWARN = -Wall -Werror
CWARN += -Wextra -Wno-unused-parameter -Wno-unused-but-set-parameter -Wpointer-arith -Wdouble-promotion -Wfloat-conversion -Wno-missing-declarations -Wno-unused-but-set-variable -Wno-sign-compare -Wno-gnu-variable-sized-type-not-at-end -Wno-undefined-internal
CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA)
CFLAGS += -DTULIP_DESKTOP -DMACOS
CFLAGS += -DTULIP_DESKTOP -DMACOS -DAMY_HAS_AUDIO_IN
CFLAGS += $(ARCHFLAGS)

# Debugging/Optimization
Expand Down
2 changes: 2 additions & 0 deletions tulip/macos/variants/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")
freeze("$(MPY_DIR)/../amy", "amy_wave.py")
freeze("$(MPY_DIR)/../amy/experiments", "tulip_piano.py")
freeze("$(MPY_DIR)/../amy/experiments", "piano_params.py")

2 changes: 1 addition & 1 deletion tulip/web/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CFLAGS += -Wall -Werror -Wdouble-promotion -Wfloat-conversion -DSTATIC=static -W
CFLAGS += -O3 -DNDEBUG
CWARN += -Wextra -Wno-unused-parameter -Wno-unused-but-set-parameter -Wpointer-arith -Wno-double-promotion -Wfloat-conversion -Wno-missing-declarations -Wno-unused-but-set-variable -Wno-sign-compare -Wno-gnu-variable-sized-type-not-at-end -Wno-undefined-internal
CFLAGS += $(INC) $(CWARN)
CFLAGS += -DTULIP_WEB -DMA_ENABLE_AUDIO_WORKLETS -sUSE_SDL=2 -DAMY_IS_EXTERNAL -DMODULE_ULAB_ENABLED=1
CFLAGS += -DTULIP_WEB -DMA_ENABLE_AUDIO_WORKLETS -sUSE_SDL=2 -DAMY_IS_EXTERNAL -DMODULE_ULAB_ENABLED=1 -DAMY_HAS_AUDIO_IN

EXPORTED_FUNCTIONS_EXTRA += ,\
_mp_js_do_exec,\
Expand Down
8 changes: 4 additions & 4 deletions tulip/web/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ set -e
source ../shared/grab_submodules.sh

cd ../../amy
make docs/amy.js
make docs/amy-audioin.js
cd ../tulip/web
cp ../../amy/docs/amy.js ../../www/run/
cp ../../amy/docs/amy.wasm ../../www/run/
cp ../../amy/docs/amy.aw.js ../../www/run/
cp ../../amy/docs/amy-audioin.js ../../www/run/
cp ../../amy/docs/amy-audioin.wasm ../../www/run/
cp ../../amy/docs/amy-audioin.aw.js ../../www/run/

make
cp build-standard/tulip/obj/micropython.wasm ../../www/run/
Expand Down
4 changes: 3 additions & 1 deletion tulip/web/variants/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
freeze("../../shared/py")
freeze("../../../amy", "amy.py")
freeze("../../../amy", "juno.py")

freeze("../../../amy", "amy_wave.py")
freeze("../../../amy/experiments", "tulip_piano.py")
freeze("../../../amy/experiments", "piano_params.py")

package(
"asyncio",
Expand Down
1 change: 1 addition & 0 deletions www/run/amy-audioin.aw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions www/run/amy-audioin.js

Large diffs are not rendered by default.

Binary file added www/run/amy-audioin.wasm
Binary file not shown.
Binary file modified www/run/amy.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion www/run/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<script src="https://cdn.jsdelivr.net/npm/webmidi@latest/dist/iife/webmidi.iife.js"></script>
<script src="micropython.mjs" type="module"></script>
<script type="text/javascript" src="enable-threads.js"></script>
<script type="text/javascript" src="amy.js"></script>
<script type="text/javascript" src="amy-audioin.js"></script>
<script type="text/javascript" src="spss.js"></script>
</head>

Expand Down
Loading

0 comments on commit 41c132a

Please sign in to comment.