feat: implement light.max_pixels
This commit is contained in:
Родитель
c686b668f2
Коммит
592af98c14
1
Makefile
1
Makefile
|
@ -58,7 +58,6 @@ BASE_TARGET ?= $(TARGET)
|
|||
PROFILES = $(patsubst targets/$(TARGET)/profile/%.c,%,$(wildcard targets/$(TARGET)/profile/*.c))
|
||||
|
||||
ifeq ($(BL),)
|
||||
DEFINES += -DDEVICE_DMESG_BUFFER_SIZE=1024
|
||||
C_SRC += $(wildcard jacdac-c/source/*.c)
|
||||
C_SRC += $(wildcard jacdac-c/services/*.c)
|
||||
C_SRC += $(wildcard jacdac-c/drivers/*.c)
|
||||
|
|
2
jacdac-c
2
jacdac-c
|
@ -1 +1 @@
|
|||
Subproject commit 4d17c9bdf347956e3edc81a7f3a029f5d758068c
|
||||
Subproject commit 941bda2ec8015efd4898ce1694114d708589601f
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "jd_config.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "hwconfig.h"
|
||||
#include "services/interfaces/jd_pins.h"
|
||||
#include "jd_config.h"
|
||||
|
||||
#define RAM_FUNC __attribute__((noinline, long_call, section(".data")))
|
||||
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
#define NOLOG(...) ((void)0)
|
||||
|
||||
#ifndef DEVICE_DMESG_BUFFER_SIZE
|
||||
#define DEVICE_DMESG_BUFFER_SIZE 1024
|
||||
#endif
|
||||
|
||||
#if DEVICE_DMESG_BUFFER_SIZE > 0
|
||||
|
||||
#if DEVICE_DMESG_BUFFER_SIZE < 256
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#define JD_CONFIG_TEMPERATURE 1
|
||||
|
||||
#include "dmesg.h"
|
||||
#include "board.h"
|
||||
#include "dmesg.h"
|
||||
|
||||
#define JD_LOG DMESG
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "jd_services.h"
|
||||
#include "dmesg.h"
|
||||
#include "pinnames.h"
|
||||
#include "jd_services.h"
|
||||
#include "interfaces/jd_app.h"
|
||||
#include "blhw.h"
|
||||
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "jd_protocol.h"
|
||||
|
||||
#include "dmesg.h"
|
||||
#include "pinnames.h"
|
||||
|
||||
#include "jd_protocol.h"
|
||||
#include "services/interfaces/jd_oled.h"
|
||||
#include "services/interfaces/jd_hw_pwr.h"
|
||||
|
||||
|
|
15
stm32/dspi.c
15
stm32/dspi.c
|
@ -1,5 +1,7 @@
|
|||
#include "jdstm.h"
|
||||
|
||||
#include "services/interfaces/jd_pixel.h"
|
||||
|
||||
#define CHUNK_LEN 3 * 4 * 2
|
||||
#define PX_SCRATCH_LEN (6 * CHUNK_LEN) // 144 bytes
|
||||
|
||||
|
@ -309,11 +311,6 @@ static void px_dma(void) {
|
|||
}
|
||||
|
||||
void px_tx(const void *data, uint32_t numbytes, uint8_t intensity, cb_t doneHandler) {
|
||||
if (px_state.pxscratch == NULL) {
|
||||
px_state.pxscratch = jd_alloc(PX_SCRATCH_LEN);
|
||||
dma_handler = px_dma;
|
||||
}
|
||||
|
||||
px_state.pxdata = data;
|
||||
px_state.pxdata_len = numbytes;
|
||||
px_state.pxdata_ptr = 0;
|
||||
|
@ -362,6 +359,13 @@ void DMA_Handler(void) {
|
|||
// 0 - 0.40us hi 0.85us low
|
||||
// 1 - 0.80us hi 0.45us low
|
||||
|
||||
void px_alloc() {
|
||||
if (px_state.pxscratch == NULL) {
|
||||
px_state.pxscratch = jd_alloc(PX_SCRATCH_LEN);
|
||||
dma_handler = px_dma;
|
||||
}
|
||||
}
|
||||
|
||||
void px_init(int light_type) {
|
||||
SPI_CLK_ENABLE();
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
|
@ -408,6 +412,7 @@ void px_init(int light_type) {
|
|||
NVIC_EnableIRQ(IRQn);
|
||||
|
||||
init_lookup();
|
||||
px_alloc();
|
||||
}
|
||||
|
||||
#endif
|
|
@ -11,3 +11,7 @@
|
|||
#define USART_IDX 1
|
||||
|
||||
#define SND_OFF 0
|
||||
|
||||
#ifndef BL
|
||||
#define DEVICE_DMESG_BUFFER_SIZE 832
|
||||
#endif
|
|
@ -8,3 +8,7 @@
|
|||
#define PIN_PWR PA_10
|
||||
#define PIN_AMOSI PA_7
|
||||
#define PIN_ASCK PA_5
|
||||
|
||||
#ifndef BL
|
||||
#define DEVICE_DMESG_BUFFER_SIZE 832
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче