Skip to content

Commit 934508d

Browse files
committed
2 parents 7b70b39 + 66c8c0a commit 934508d

File tree

7 files changed

+49
-47
lines changed

7 files changed

+49
-47
lines changed

.github/workflows/MarkdwonLinksCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
with:
2121
paths: '*.md ./CI/**/*.md, ./variants/**/*.md, ./libraries/**/*.md'
2222
verbosity: 'INFO'
23-
linksToSkip: 'www.st.com, de.elv.com/lorawan'
23+
linksToSkip: 'www.st.com, blues.com'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
789789
| :green_heart: | STM32F765VI | [RemRam v1](https://github.com/hasenbanck/remram) | *1.4.0* | |
790790
| :green_heart: | STM32F446VE | [RUMBA32](https://github.com/Aus3D/RUMBA32) | *1.5.0* | |
791791
| :green_heart: | STM32F401VE | [STEVAL-3DP001V1](https://www.st.com/en/evaluation-tools/steval-3dp001v1.html) | *1.6.0* | |
792-
| :green_heart: | STM32F446RE | [VAkE v1.0](https://www.facebook.com/pages/category/Product-Service/VAkE-Board-2290066274575218/) | *1.6.0* | |
792+
| :green_heart: | STM32F446RE | VAkE v1.0 | *1.6.0* | |
793793
| :green_heart: | STM32F446VE | [FYSETC_S6](https://wiki.fysetc.com/FYSETC_S6/) | *1.9.0* | |
794794
| :green_heart: | STM32G0B1CB | [BTT EBB42 CAN V1.1](https://github.com/bigtreetech/EBB/tree/master) | *2.4.0* | |
795795

@@ -860,7 +860,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
860860
| :green_heart: | STM32F405RG | [SparkFun MicroMod Processor Board - STM32F405](https://www.sparkfun.com/products/21326) | *2.6.0* | |
861861
| :green_heart: | STM32WB5MMG | [SparkFun MicroMod Processor Board - STM32WB5MMG](https://www.sparkfun.com/products/21438) | *2.6.0* | |
862862

863-
### [ELV Boards](https://de.elv.com/lorawan)
863+
### [ELV Boards](https://de.elv.com/)
864864

865865
| Status | Device(s) | Name | Release | Notes |
866866
| :----: | :-------: | ---- | :-----: | :---- |

cores/arduino/Print.cpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -374,52 +374,52 @@ size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
374374
char buf[64];
375375
uint8_t i = 0;
376376
uint8_t innerLoops = 0;
377+
size_t bytes = 0;
377378

378379
// Special case workaround https://github.com/arduino/ArduinoCore-API/issues/178
379380
if (n64 == 0) {
380381
write('0');
381-
return 1;
382-
}
383-
384-
// prevent crash if called with base == 1
385-
if (base < 2) {
386-
base = 10;
387-
}
388-
389-
// process chunks that fit in "16 bit math".
390-
uint16_t top = 0xFFFF / base;
391-
uint16_t th16 = 1;
392-
while (th16 < top) {
393-
th16 *= base;
394-
innerLoops++;
395-
}
382+
bytes = 1;
383+
} else {
384+
// prevent crash if called with base == 1
385+
if (base < 2) {
386+
base = 10;
387+
}
396388

397-
while (n64 > th16) {
398-
// 64 bit math part
399-
uint64_t q = n64 / th16;
400-
uint16_t r = n64 - q * th16;
401-
n64 = q;
402-
403-
// 16 bit math loop to do remainder. (note buffer is filled reverse)
404-
for (uint8_t j = 0; j < innerLoops; j++) {
405-
uint16_t qq = r / base;
406-
buf[i++] = r - qq * base;
407-
r = qq;
389+
// process chunks that fit in "16 bit math".
390+
uint16_t top = 0xFFFF / base;
391+
uint16_t th16 = 1;
392+
while (th16 < top) {
393+
th16 *= base;
394+
innerLoops++;
408395
}
409-
}
410396

411-
uint16_t n16 = n64;
412-
while (n16 > 0) {
413-
uint16_t qq = n16 / base;
414-
buf[i++] = n16 - qq * base;
415-
n16 = qq;
416-
}
397+
while (n64 > th16) {
398+
// 64 bit math part
399+
uint64_t q = n64 / th16;
400+
uint16_t r = n64 - q * th16;
401+
n64 = q;
402+
403+
// 16 bit math loop to do remainder. (note buffer is filled reverse)
404+
for (uint8_t j = 0; j < innerLoops; j++) {
405+
uint16_t qq = r / base;
406+
buf[i++] = r - qq * base;
407+
r = qq;
408+
}
409+
}
417410

418-
size_t bytes = i;
419-
for (; i > 0; i--) {
420-
write((char)(buf[i - 1] < 10 ?
421-
'0' + buf[i - 1] :
422-
'A' + buf[i - 1] - 10));
411+
uint16_t n16 = n64;
412+
while (n16 > 0) {
413+
uint16_t qq = n16 / base;
414+
buf[i++] = n16 - qq * base;
415+
n16 = qq;
416+
}
417+
bytes = i;
418+
for (; i > 0; i--) {
419+
write((char)(buf[i - 1] < 10 ?
420+
'0' + buf[i - 1] :
421+
'A' + buf[i - 1] - 10));
422+
}
423423
}
424424
return bytes;
425425
}

libraries/SPI/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## SPI
22

33
STM32 SPI library has been modified with the possibility to manage hardware CS pin linked to the SPI peripheral.
4-
_We do not describe here the [SPI Arduino API](https://www.arduino.cc/en/Reference/SPI) but the functionalities added._
4+
_We do not describe here the [SPI Arduino API](https://docs.arduino.cc/language-reference/en/functions/communication/SPI/) but the functionalities added._
55

66
User have 2 possibilities about the management of the CS pin:
77
* the CS pin is managed directly by the user code before to transfer the data (like the Arduino SPI library)

libraries/USBDevice/inc/cdc_queue.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ extern "C" {
5454
#define CDC_QUEUE_MAX_PACKET_SIZE USB_FS_MAX_PACKET_SIZE
5555
#endif
5656

57+
#define CDC_TRANSMIT_MAX_BUFFER_SIZE 65472 //STM32 USB OTG DIEPTSIZ PKTCNT maximum 0x3ff
5758
#define CDC_RECEIVE_MAX_BUFFER_SIZE CDC_QUEUE_MAX_PACKET_SIZE
5859

5960
#ifndef CDC_TRANSMIT_QUEUE_BUFFER_PACKET_NUMBER
@@ -83,7 +84,7 @@ void CDC_TransmitQueue_Init(CDC_TransmitQueue_TypeDef *queue);
8384
int CDC_TransmitQueue_WriteSize(CDC_TransmitQueue_TypeDef *queue);
8485
int CDC_TransmitQueue_ReadSize(CDC_TransmitQueue_TypeDef *queue);
8586
void CDC_TransmitQueue_Enqueue(CDC_TransmitQueue_TypeDef *queue, const uint8_t *buffer, uint32_t size);
86-
uint8_t *CDC_TransmitQueue_ReadBlock(CDC_TransmitQueue_TypeDef *queue, uint32_t *size, uint32_t maxsize);
87+
uint8_t *CDC_TransmitQueue_ReadBlock(CDC_TransmitQueue_TypeDef *queue, uint32_t *size);
8788
void CDC_TransmitQueue_CommitRead(CDC_TransmitQueue_TypeDef *queue);
8889

8990
void CDC_ReceiveQueue_Init(CDC_ReceiveQueue_TypeDef *queue);

libraries/USBDevice/src/USBSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ size_t USBSerial::readBytes(char *buffer, size_t length)
124124

125125
size_t USBSerial::readBytesUntil(char terminator, char *buffer, size_t length)
126126
{
127-
size_t read;
127+
uint32_t read;
128128
size_t rest = length;
129129
_startMillis = millis();
130130
do {

libraries/USBDevice/src/cdc/cdc_queue.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,16 @@ void CDC_TransmitQueue_Enqueue(CDC_TransmitQueue_TypeDef *queue,
7777

7878
// Read flat block from queue biggest as possible, but max QUEUE_MAX_PACKET_SIZE
7979
uint8_t *CDC_TransmitQueue_ReadBlock(CDC_TransmitQueue_TypeDef *queue,
80-
uint32_t *size,
81-
uint32_t maxsize)
80+
uint32_t *size)
8281
{
8382
if (queue->write >= queue->read) {
8483
*size = queue->write - queue->read;
8584
} else {
8685
*size = CDC_TRANSMIT_QUEUE_BUFFER_SIZE - queue->read;
8786
}
88-
if(*size > maxsize) *size = maxsize;
87+
if (*size > CDC_TRANSMIT_MAX_BUFFER_SIZE) {
88+
*size = CDC_TRANSMIT_MAX_BUFFER_SIZE;
89+
}
8990

9091
queue->reserved = *size;
9192
return &queue->buffer[queue->read];

0 commit comments

Comments
 (0)