[uquote="arkhnchul",url="/forum/viewtopic.php?p=3523966#p3523966"]это еще сильно тормозится сложностью языка по сравнению с C.[/uquote]
В ардуине не тормозится, а здесь тормозится? Какой интересный аргумент, однако.
ктсати, вот прям навскидку ST один из весьма активных контрибуторов mbed)
Не смогу похвастаться, что я хорошо знаком с
mbed, но единственной библиотекой, которая мне показалось сколь нибудь полезной из всего проекта, оказалась
mbedtls. Считайте, что я говорю это нарочно, но в библиотеке не оказалось ни одной строчки на C++.
А теперь об ООП-софтах, составляющих рейтинг "Most Popular Code" на сайте mbed.org:
1. Mbed / OS 2 mbed_blinky
2. mbed official / mbed
3. Blinky LED test for ST Nucleo boards
4. Output a pwm signal.
5. TextLCD library for controlling various LCD panels based on the HD44780 4-bit interface
6. mbed-os-examples / OS 5 mbed-os-example-blinky
7. ST / OS 2 Nucleo_read_analog_value
8. ST / OS 2 Nucleo_printf
По совокупности, светодиодно-мигательная тема лидирует с ошеломительным отрывом и наглядно показывает, насколько и в каких областях ценны все эти
mbed-ы и кто их использует.
Добавлено after 28 minutes 37 seconds:
[uquote="Ярослав555",url="/forum/viewtopic.php?p=3524116#p3524116"]Ни слова о том что как-то определяется конец пакета.[/uquote]
Все там определяется, начиная с F030, только документация об этом умалчивает. Если же прочесть RM0091, то открывается совершенно иная картина:
27.5.8 Modbus communication using USART
The USART offers basic support for the implementation of Modbus/RTU and Modbus/ASCII
protocols. Modbus/RTU is a half duplex, block transfer protocol. The control part of the
protocol (address recognition, block integrity control and command interpretation) must be
implemented in software.
The USART offers basic support for the end of the block detection, without software
overhead or other resources.
Modbus/RTU
In this mode, the end of one block is recognized by a “silence” (idle line) for more than 2
character times. This function is implemented through the programmable timeout function.
The timeout function and interrupt must be activated, through the RTOEN bit in the
USART_CR2 register and the RTOIE in the USART_CR1 register. The value corresponding
to a timeout of 2 character times (for example 22 x bit duration) must be programmed in the
RTO register. when the receive line is idle for this duration, after the last stop bit is received,
an interrupt is generated, informing the software that the current block reception is
completed.
Modbus/ASCII
In this mode, the end of a block is recognized by a specific (CR/LF) character sequence.
The USART manages this mechanism using the character match function.
By programming the LF ASCII code in the ADD[7:0] field and by activating the character
match interrupt (CMIE=1), the software is informed when a LF has been received and can
check the CR/LF in the DMA buffer