Skip to content

Commit

Permalink
reducing offscreen X and fixing juno6 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Jun 9, 2024
1 parent 3f1d61b commit b3f222a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion amy
Submodule amy updated from 6b3ef7 to d39771
2 changes: 1 addition & 1 deletion lv_binding_micropython_tulip/lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#if LV_MEM_ADR == 0
#ifdef ESP_PLATFORM
#define LV_MEM_POOL_INCLUDE "esp_heap_caps.h"
#define LV_MEM_POOL_ALLOC(size) heap_caps_malloc(size, MALLOC_CAP_SPIRAM)
#define LV_MEM_POOL_ALLOC(size) malloc_caps(size, MALLOC_CAP_SPIRAM)
#else
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
Expand Down
17 changes: 2 additions & 15 deletions tulip/esp32s3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,8 @@ void esp_alloc_failed(size_t size, uint32_t caps, const char *function_name) {
printf("\n");
}

/*
void esp_heap_trace_alloc_hook(void* ptr, size_t size, uint32_t caps) {
fprintf(stderr,"alloc %d bytes ", size);
if(caps & MALLOC_CAP_SPIRAM) fprintf(stderr,"spiram ");
if(caps & MALLOC_CAP_INTERNAL) fprintf(stderr,"internal ");
if(caps & MALLOC_CAP_32BIT) fprintf(stderr,"32bit ");
if(caps & MALLOC_CAP_DEFAULT) fprintf(stderr,"default ");
if(caps & MALLOC_CAP_IRAM_8BIT) fprintf(stderr,"iram8bit ");
if(caps & MALLOC_CAP_RTCRAM) fprintf(stderr,"rtcram ");
if(caps & MALLOC_CAP_8BIT) fprintf(stderr,"8bit ");
if(caps & MALLOC_CAP_EXEC) fprintf(stderr,"exec ");
if(caps & MALLOC_CAP_DMA) fprintf(stderr,"dma ");
fprintf(stderr,"\n");
}
*/



float compute_cpu_usage(uint8_t debug) {
TaskStatus_t *pxTaskStatusArray;
Expand Down
2 changes: 1 addition & 1 deletion tulip/shared/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern const unsigned char portfolio_glyph_bitmap[1792];
//#define OFFSCREEN_X_PX 0
//#define OFFSCREEN_Y_PX 0

#define OFFSCREEN_X_PX 1024
#define OFFSCREEN_X_PX 128
#define OFFSCREEN_Y_PX 100
#define DEFAULT_PIXEL_CLOCK_MHZ 28
#define BOUNCE_BUFFER_SIZE_PX (H_RES*12)
Expand Down
2 changes: 1 addition & 1 deletion tulip/shared/polyfills.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int32_t get_ticks_ms() {

void *calloc_caps(uint32_t align, uint32_t count, uint32_t size, uint32_t flags) {
#ifdef ESP_PLATFORM
//fprintf(stderr, "callocing count %ld size %ld flags %ld\n", count, size, flags);
//if(flags & MALLOC_CAP_SPIRAM) fprintf(stderr, "spiram callocing count %ld size %ld flags %ld\n", count, size, flags);
return heap_caps_aligned_calloc(align, count, size, flags);
#else
return (void*)malloc(size*count);
Expand Down
19 changes: 6 additions & 13 deletions tulip/shared/py/juno6.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,20 +610,13 @@ def control_change(control, value):



def midi_event_cb(x):
m = tulip.midi_in()
while m is not None and len(m) > 0:
if m[0] == 0xb0: # Other control slider.
def midi_event_cb(m):
if m[0] == 0xb0: # Other control slider.
control_change(m[1], m[2])
elif m[0] == 0xbf:
# Special case for Oxygen49 transport buttons which send val 0x00 on release.
if m[2] == 0x7f:
control_change(m[1], m[2])
elif m[0] == 0xbf:
# Special case for Oxygen49 transport buttons which send val 0x00 on release.
if m[2] == 0x7f:
control_change(m[1], m[2])

# Are there more events waiting?
m = m[3:]
if len(m) == 0:
m = tulip.midi_in()

def refresh_with_new_music_map():
"""Called when the active midid channels changes, so we can update menu."""
Expand Down

0 comments on commit b3f222a

Please sign in to comment.