Add BME280 over SPI

This commit is contained in:
Edward Emelianov
2025-10-05 00:10:02 +03:00
parent f994799353
commit 17b4d714e0
16 changed files with 826 additions and 39 deletions

View File

@@ -165,7 +165,16 @@ int USB_sendall(){
int USB_send(const uint8_t *buf, int len){
if(!buf || !CDCready || !len) return FALSE;
while(len){
int a = RB_write((ringbuffer*)&rbout, buf, len);
IWDG->KR = IWDG_REFRESH;
int l = RB_datalen((ringbuffer*)&rbout);
if(l < 0) continue;
int portion = rbout.length - 1 - l;
if(portion < 1){
if(lastdsz == 0) send_next();
continue;
}
if(portion > len) portion = len;
int a = RB_write((ringbuffer*)&rbout, buf, portion);
if(a > 0){
len -= a;
buf += a;