jfpoilpret / fast-arduino-lib

C++ platform to build Arduino and AVR projects. Rationale is size and speed optimization.
GNU Lesser General Public License v2.1
59 stars 9 forks source link

Review (replace?) virtual methods in ostreambuf and futures #99

Closed jfpoilpret closed 2 years ago

jfpoilpret commented 2 years ago

FastArduino uses virtual methods in several occasions (as few as possible), sometimes with C++ virtual keyword, sometimes with a specific support header.

  1. ostreambuf: uses FastArduino virtual support: FastArduiono virtual support header is heavy and more complex than needed; it would be better to either use virtual methods (explicit behavior) or replace with another mechanism that is more "static" (like the current support for ISR)
  2. futures use virtual methods: futures are heavily used in ISR but virtual methods impose a lot of push/pop registers which are generally not necessary. We should infer on a more static way if possible
jfpoilpret commented 2 years ago

PR #100 deals with ostreambuf part and has been merged to master. Now need to deal with Future virtual calls (may be much more difficult or even impossible).

jfpoilpret commented 2 years ago

PR #102 deals with Future part and has been merged to master. This PR also includes necessary adaptations to I2C following future changes..