Git Product home page Git Product logo

fast-arduino-lib's Introduction

Latest News

FastArduino v1.10 has been released on 16th May 2023. The implemented enhancements are listed here. Mainly this release brings generic support for display devices and concrete implementation for Nokia 5110 LCD display. More details are provided in the release notes.

FastArduino

FastArduino is a C++ object-oriented library for Arduino boards based on AVR MCU and also for bare AVR MCU.

FastArduino API is fully documented here and documentation also includes a complete tutorial.

FastArduino C++ code is also analyzed by SonarQube and results of this analysis are published from time to time here.

FastArduino benefits are:

  • provide smaller and faster code than other libraries for the same functionality
  • ensure you pay (size and speed) only for what you use
  • use modern C++ Object-Oriented Design everywhere
  • reduce risk of bad code, e.g. by preventing usage, at compile time, of unexisting features (pins, timers...) for the target MCU
  • support event-driven programs
  • support both ATmega and ATtiny chips

From my viewpoint, the main issues with other third-party Arduino libraries are essentially heavy usage of virtual methods, which quickly increases code size when you start to define deep classes hierarchies; this also can have a slight impact on speed due to additional indirection when calling methods. Calling virtual methods from an ISR also has a big impact on code size as the generated code for ISR will push all registers to the stack, then call your ISR code, and finally pop all registers back from the stack; of course, this also has a dramatic impact on ISR execution speed. Avoiding virtual methods calls from an ISR ensures the compiler generates only the strict minimum of push and pop necessary.

FastArduino tries to favour C++ templates rather than virtual methods whenever possible; in the very rare locations where virtual methods are used, their number is reduced to the minimum needed (abstract virtual methods only, typically used for event handlers, generally limited to hierarchy of 2 levels only, one abstract parent and direct children).

Also, no ISR gets automatically declared by FastArduino: every program declares the ISR it needs by using pre-defined FastArduino ISR-registration macros (note that ISR registration is the only feature for which FastArduino uses macros). FastArduino does not use virtual methods for ISR callbacks, thus permitting optimization of ISR code size, which would not have been possible with virtual methods as callbacks.

Note that, if you consider using FastArduino for your projects, you should be aware that FastArduino does not support Arduino API and does not intend to do so some day. That means you will have to first learn FastArduino API (you can use the complete tutorial and the numerous examples provided for that) in order to reap its benefits. FastArduino is definitely not for newcomers to C++ programming as it makes heavy use of C++ specificities. FastArduino currently uses C++17 standard.

Since the initial drafts, I decided not to be compliant with Arduino IDE as I find it is a real pain. All my projects (including FastArduino itself) are now built with Visual Studio Code along with a small extension I developed specifically for FastArduino. Once properly setup, I find VS Code environment very easy and friendly to use.

FastArduino is also buildable from the command line (on a linux system) through the standard make. Its make system can also be used for projects using the FastArduino library.

Making FastArduino buildable on Arduino IDE is not on the roadmap.

My complete setup is described in ArduinoDevSetup.docx. This document also describes how I setup Visual Studio Code for my projects.

One easy way to start a new project using FastArduino is to checkout this project template.

Limitations

Since version 1.9, FastArduino prevents usage of dynamic allocation (new and delete) because it is bad for AVR MCU with such limited amount of SRAM, as it may lead to heap fragmentation and ultimately program crash.

FastArduino has always encouraged static allocation only, throughout its API and implementation.

Allowing dynamic allocation would have undesirable effects on classes with virtual methods: they should also define a virtual destructor, which has an impact on generated code and data (vtable) size. Hence, we have decided to not define virtual destructors in such FastArduino classes, and prevent overall dynamic allocation to avoid virtual destructors.

Status

Latest FastArduino release v1.10 has been published on 16.05.2023.

In the current version, the project covers almost all features; a few missing, less important, features will be released in future versions (see roadmap below); the API of current features is deemed stable and should not change in the future.

What the library has:

  • Fast digital IO support: template-based, optimized for speed and size
  • Pin Change Interrupt (PCI) handling
  • External Pin Interrupt handling
  • Analog Digital Conversion support (in Single Conversion mode)
  • Analog Comparator support
  • Flash memory data support (PROGMEM data), particularly strings (useful to limit used SRAM)
  • Hardware UART support (for MCU that support it, ie not for ATtiny)
  • Software UART support (for all MCU)
  • "C++ like" Input/Output streams (used by UART implementations)
  • Timer modes support, including Input Capture and Square Waves generation
  • Timed (periodic or not) jobs scheduling
  • Real Time Timer with microsecond precision
  • PWM output support
  • "Pulsed" Timer support (useful for Servos)
  • General utilities (queues, linked lists, busy loop delays)
  • "Future" support for asynchronous computation (e.g. ISR-based)
  • SPI master support
  • I2C master support with both synchronous and asynchronous modes supported (asynchronous only for ATmega MCU)
  • EEPROM support, with synchronous or asynchronous write
  • General Events handling
  • Watchdog timer
  • Power sleep
  • Power supply voltage measurement support
  • Generic support for display devices, integrating several drawing primitives, fonts...

In addition, FastArduino brings support for the following devices:

  • Tones generation & melody player (e.g. to produce notes through a buzzer)
  • SIPO (Serial in Parallel out) chips
  • Servo control API
  • WinBond flash memory support (SPI-based)
  • NRF24L01 device support (SPI-based)
  • DS1307 RTC device support (I2C-based)
  • HMC5883L magnetometer device support (I2C-based)
  • MPU-6050 accelerometer/gyroscope device support (I2C-based)
  • MCP23008 8-Bit I/O Expander (I2C-based)
  • MCP23017 16-Bit I/O Expander (I2C-based)
  • MCP3008 8-channel Analog-Digital Converter (SPI-based) and other chips from the same family
  • HC-SR04 sonar device support in synchronous and asynchronous modes
  • VL53L0X laser distance sensor device (I2C-based)
  • Grove 125KHz RFID reader (both UARX and Wiegand modes supported)
  • Nokia 5110 LCD device (SPI-based)

As of now, the following platforms are supported (and tested):

  • Arduino UNO
  • Arduino NANO
  • Arduino MEGA
  • Arduino Leonardo (with only partial USB support)
  • Breadboard ATmega328 at 8MHz and 16MHz
  • Breadboard ATmega164/324/644/1284 at 8MHz and 16MHz (note: only 644 and 1284 are actually tested)
  • Breadboard ATtiny84 at 8MHz
  • Breadboard ATtiny85 at 8MHz

I intend to probably add support some day for:

  • Arduino Leonardo with full USB support

A step-by-step tutorial is available for those who want to learn FastArduino API; it covers the whole FastArduino core API. In addition to that, the FastArduino API is fully documented through doxygen.

Project structure

The project is organized according to the following structure:

  • /: root project directory
    • cores/fastarduino: FastArduino platform C++ source code

    • tools: Provide simple tools to edit fonts and bitmaps, to be used with FastArduino Display class

    • make: utility makefiles and scripts to build FastArduino library, generate docs, and prepare releases

    • examples: source code of basic examples of all FastArduino features, gathered by categories

    • .vscode: project settings for Visual Studio Code

    • docs: created by doxygen, contains all docs generated in HTML format, published here

    • basedoc: other various project documentation

    • dox: doxygen documentation source files and settings

    • tuto-samples: source code of samples used in tutorial; samples are often present in 2 flavours, Arduino API and FastArduino, in order to compare their respective sizes

    • example-boards: contains schemas (produced with LochMaster software) of stripboards that I use for FastArduino runtime tests

    • refs: contains datasheets for AVR MCU and external devices supported by FastArduino

    • build: created at build time, contains object files

    • deps: created at build time, contains all source code dependencies

    • dist: created at build time, contains FastArduino library for various targets

    • apidocs: created by doxygen, contains docs generated in LATEX format

Roadmap

The roadmap of next activities and new supported features is the following:

Documentation - no milestones

  • Document how to add support for other boards in Tutorial (2nd half 2023)

Milestones dates are "best effort" and may change based on contributors' availability.

The following features are not in FastArduino roadmap currently (but may be in the future):

  • OWI support

fast-arduino-lib's People

Contributors

jfpoilpret avatar urdh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fast-arduino-lib's Issues

project status

Dear developer,
this library is something I was looking for a long time. What is the project status, is it still alive?
Best regards, Susnicek

Improve TonePlayer to support asynchronous play.

Currently, when TonePlayer plays a melofy it blocks the main loop until the melody finishes.
In particular, all delays for playing each note are busy loop delays.

Although in latest commits, it can be stopped, it is not enough.
It should be possible to play a melody entirely asynchronously (based only on timer interrupts).

Add support for ATtinyX5 MCU

Currently FastArduino supports several Arduino boards and Atmel MCU:

  • Arduino UNO
  • Arduino NANO
  • Arduino Leonardo
  • Arduino MEGA2560
  • ATmega328
  • ATtinyX4

There are some simple circuits, with few IOs, that do not require using an ATtinyX4, but would perfectly fit a smaller MCU like the ATtinyX5.

Adding support for ATtinyX5 in FastArduino would allow using the library for such simpler circuits.

Support asynchronous I2C operations

I2C is a rather slow protocol (100KHz or 400KHz, depending on connected devices).
Currently, FastArduino support for I2C is completely synchronous, i.e. any read or write is blocking the caller even though it may last several milliseconds (for big payloads).

Adding an asynchronous mode of operation could be useful. API is to be determined for easy use.

Add FastDigialPin as type

I do not (yet) have a github fork from your repository so this as an issue.

I am not experienced in c++ templates but looking thru your code and a lot of reading :
When you add :

	template<board::DigitalPin DPIN_>
	using FastDigitalPin = typename FastPinType<DPIN_>::TYPE;
	/// @endcond

}
#endif /* FASTIO_HH */
/// @endcond 

to the end of gpio.h
You add the functionality to use

     FastDigitalPin<DigitalPin::LED> led{PinMode::FASTOUTPUT};

as alternative for

     FastPinType<DigitalPin::LED>::TYPE led2(PinMode::FASTOUTPUT);

Leading to more readable an understandable code

Enhance build automation

Improve build automation to:

  • generate a sheet with all sizes of all examples in all supported targets
  • trigger alarms in case of important size variation between 2 builds (size increase may mean bad code optimization or refactoring, size decrease may be triggered by a new bug in code)
  • directly integrate snippets and their sizes in tutorial (both Arduino IDE and FastArduino)

Not sure how far we can go on the third point, that will depend a lot on doxygen facilities.

Compatibility with avr libraries

Hi @jfpoilpret,
it would be nice that fast-arduino-libs were compatible with standard avr Libc libraries (e.g. avr/io.h etc.). This compatibility is preserved with arduino libraries (avr headers can be normally used), however, concurrent use of fast-arduino-libs and avr headers ends with errors.

Best regards, S.

Add support for SD card readers

Still to be defined: format(s) to support (FAT16, FAT32, others...)
File API shall be integrated to iostream API (for text files).

Improve APIDOC to properly generate sub-namespace docs

Currentl, doxygen generation seems to "forget" some namespaces (or more precisely, namespaces inside namespaces) in some of the generated files:
image
In the example above, as we can see, we have the following issues:

  • the description of namespace devices is incorrect (that's the description for namespace devices::rtc)
  • the following devices sub-namespaces are missing: audio, magneto, rf...)

The problem might be due to doxygen comments directly set before declarations like:

namespace devices::rtc 
{
...
}

Improve API for EXT and PCI pins

Currently, EXT and PCI pins are just listed, for each board, as namespaces (ExternalInterruptPin and InterruptPin) with constant DigitalPin values.
This means that any API requiring an EXT or PCI pin as argument, actually defines the argument type as DigitalPin and the adds static_assert calls to check the actual pin.
This is fine but this prevents proper code completion in an IDE.

A much better way would be to replace the 2 namespaces with 2 strong enum types.
This will have an impact on all API, and examples, using EXT and PCI pins.

Add support for Input Capture Noise Canceler

FastArduino currently supports Input Capture on timers with this feature.
But this specific timer feature on AVR also includes an optional Input Capture Noise Canceler.
FastArduino Timer API should also support this option.

Improve TonePlay to use musical duration instead of ms

The current way Toneplay and QTonePlay structs are defined only allows to specify notes durations as milliseconds.
This has the following impact:

  • hard to transpose a musical score
  • impossible to change tempo at play time

A better way would use normal musical notation for notes duration:

  • whole note
  • half note
  • quarter
  • eighth
  • sixteenth
  • thirty-second

And it shall also include dotted notes (not sure double-dots are needed, I haven' seen a lot of scores using them).

In addition, it should be possible to support slurs and ties (concretely that would mean no internote delay).

Finalize API documentation

FastArduino API, although currently well documented through doxygen markup, is not fully documented yet.

Among undocumented important namespaces, there are:

  • containers
  • events (partly documented)
  • eeprom
  • spi
  • i2c

Also, supported devices have not yet been documented, e.g.:

  • DS1307 (RTC)
  • MPU6050 (Accelerometer-Gyroscope)
  • ...

API documentation is very important to ease use of an API, in particular when an API may be more complex than usual.

Support PWM pins of ATtiny85 Timer1

Currently, FastArduino ATtiny85 support enables only 2 PWM pins, both based on Timer0.

Event though currently FastArduino does not allow support for PWM pins linked to more than 1 timer, that still leaves room for pin PB4 (OC1B).

Improve software UART implementation

Current serial::soft::UATX implementation should be improved to:

  • prevent pushing chars to associated queue after end() has been called
  • flush all queued characters when end() is called

Both serial::soft::UATX and serial::soft::UARX shall have their code (generated assembly) be reviewed and optimized to be able to support all transfer speeds up to 230400bps (or more).

Add support for user-selectable crystal frequencies

Dear developer,
I would like to ask if it is possible to add a support for user-selectable crystal frequencies. Maybe F_CPU macro will work, I do not know.
My point is to use your library for general code development for processors ATmega, ATtiny and their families. And I do not want to be bound to a specific board platform with pre-soldered crystals etc. Will be your library also aimed this way?

Best regards, Susnicek

Support ADC auto trigger modes.

Currently analog::AnalogInput allows ADC on-demand (just by calling sample()).

AVR MCU ADC circuitry offers more interesting features, in particular "auto trigger" which allows repeated sampling on an analog input pin.

It would be nice to support this feature and propose a callback notification when e.g. latest sample has changed.

This may require refactoring of analog namespace because auto-trigger mode can work with only one analog input and shall prevent on-demand sampling while active.

Review SonarQube reported issues

Latest SonarQube scan shows a lot of issues.
It is important to either:

  • fix issues that deserve fixing
  • change SonarQube rules settings for rules that need it
    Find if it is possible to define false positive on issues (normally available with SonarQube, but it does not seem to work on cloud instance?)

Review all register methods for ISR and call from constructor when possible.

Many FastArduino API classes define a public register_xxx_handler() method when it has callback methods to be called by an ISR (itself registered with one REGISTER_XXX macro).

In most cases currently, calling this method is the responsibility of the application developer, but it is easy to forget and in this case, it may take time to understand why the program does not seem to work at all!

The purpose of this issue is to review all FastArduino classes with a public register_xxx_handler() method, check if that method should rather be called at construction time, and if so, simply move its code to the constructor(s).

Reorganize project root directory

There are too many files in the root directory:

  • make files & utility scripts
  • documentation and examples sizes

Some of these files would better be located in a specific sub directory, so that the root directory contains only important files (e.g README, licenses...)

MEGA InterruptPin D15_PJ0_PCI1 & D14_PJ1_PCI1 not properly handled

Refer to example PinChangeInterrupt1bugMEGA for a demo.
The MEGA has peculiar implementation of PCINT1 registers; these registers group PCI pins from 2 different ports (PE and PJ), leading to a bit shift in these registers.
FastArduino, in its current implementation, takes it for granted that PCINT registers bits map to the corresponding bits of one single port.

The failing API is interrupt::PCISignal<board::Port>:: enable_pin<board::InterruptPin>() (and similar API: disable_pin(), enable_pin_(), disable_pin_()).

The proper correction for this bug would consist in in refactoring FastArduino traits related to PCINT in order to:

  1. Allow bit shifts in registers masks
  2. Allow more than one port for a single PCINT vector

One possible workaround (ugly) is to use interrupt::PCISignal<board::Port>:: enable_pins(mask) with the proper mask.

Update AVR GCC Toolchain to v3.6.x

Today FastArduino relies on the rather old AVR8 GNU toolchain 3.5.4 (gcc 4.9.2), used with C++11 standard.

New toolchains have been released recently and provide support for more recent C++ standards.

As of today, the latest toolchain seems to be 3.6.1 (gcc 5.4.0). It would be nice to install it and check if:

  • FastArduino make system still works with it (probably some options need to be adapted)
  • FastArduino examples all compile with all targets
  • Examples run on each target
  • Code size is not larger than before
  • Some new options may be used for further FastArduino optimization
  • C++14 could be the C++ standard for FastArduino)

Add slave mode for SPI

Current SPI support in FastArduino only supports the running MCU to act as the SPI master.

There are some occasions where we might need Arduino to be an SPI slave, e.g. when using SPI to connect 2 Arduinos together.

Improve code to be better C++

Review all classes and implement (or forbid) the following:

  • copy constructor
  • move constructor
  • assignment
    This is not of absolute priority of course, but we all love perfectly clean code.

Allow timer selection for PWM pin attached to several timers

Some AVR MCU have PWM pins that may be attached to more than one timer (only one at a time of course).
Currently, FastArduino supports only one PWM Timer for a given pin, hence an arbitrary choice is made when support is added for an MCU.

It would be nice to allow timer selection for those PWM pins that are linkable to several timers.

Library compilation problem

Dear @jfpoilpret,

I followed the documentation and tried to compile the fast-arduino-lib package using the command 'make CONF=UNO build'. However, the command yielded the following error:

avr-g++ -MT build/ARDUINO_UNO-16MHz/cores/fastarduino/soft_uart.o -MMD -MP -MF deps/ARDUINO_UNO-16MHz/cores/fastarduino/soft_uart.Td -mmcu=atmega328p -DF_CPU=16000000UL -DARDUINO_UNO -DNO_ABI -fno-exceptions -Wextra -flto -felide-constructors -Os -ffunction-sections -fdata-sections -mcall-prologues -g -Wall -I /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores -std=c++17 -c -o build/ARDUINO_UNO-16MHz/cores/fastarduino/soft_uart.o /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.cpp In file included from /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.cpp:15:0: /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.h:67:17: error: expected '{' before '::' token namespace serial::soft ^ /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.h:67:19: error: 'soft' in namespace '::' does not name a type namespace serial::soft ^ /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.h:176:39: error: expected '}' before end of line /media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/cores/fastarduino/soft_uart.h:176:39: error: expected declaration before end of line make: *** [/media/data/Documents/Elektro/FastArduino/fast-arduino-lib-master/Makefile-common.mk:131: build/ARDUINO_UNO-16MHz/cores/fastarduino/soft_uart.o] Error 1

My compilation attempt was performed under the Debian Linux 4.19.37-5 (Sid), version of my avr-g++ is 5.4.0. Any advice on this issue?

Best regards, Susnicek

Improve Queue implementation to support any buffer size.

The current Queue implementation only supports powers of 2 for its buffer size, for performance (code size and speed) reasons.
But this may force usage of a buffer much bigger than needed (e.g. 64 items when you need maximum 40).
In addition, the actual queue size is 1 less than the real buffer size, which adds to the wasted SRAM space.

Investigate if allowing ANY size would impact performance a lot or not really much.
If impact is too important, study the possibility to have 2 distinct implementations for Queue, one optimized and the other not.

Copyright violations

@jfpoilpret After reading a fair amount of the code I see that much is directly copied from the Cosa repository and then slightly updated, e.g. file name, inheritance/template, etc. In most cases the original Cosa copyright notice has been removed.

Document how to create new I2C and SPI devices in tutorial

FastArduino provides a "framework" for building I2C and SPI devices more easily.
Although this API is already documented, it would be nice to have a dedicated tutorial part describing how to create new devices (SPI or I2C) for FastArduino, with practical examples and best practice.

Add slave mode support for I2C

Current I2C support in FastArduino only supports the running MCU to be the I2C bus master.

There are some occasions where we might need Arduino to be a slave on the I2C bus.

MPU6050::all_measures swaps accelerometer and gyroscope

Using the following snippet:

devices::magneto::Sensor3D accel;
accelgyro.accel_measures(accel);

devices::magneto::Sensor3D gyro;
accelgyro.gyro_measures(gyro);

devices::magneto::AllSensors sensors;
accelgyro.all_measures(sensors);

output << streams::setw(6) << "var"   << " |" << streams::setw(8) << "sep."  << " |" << streams::setw(8) << "comb."         << "\r\n";
output << streams::setw(6) << "ACC_X" << " |" << streams::setw(8) << accel.x << " |" << streams::setw(8) << sensors.accel.x << "\r\n";
output << streams::setw(6) << "ACC_Y" << " |" << streams::setw(8) << accel.y << " |" << streams::setw(8) << sensors.accel.y << "\r\n";
output << streams::setw(6) << "ACC_Z" << " |" << streams::setw(8) << accel.z << " |" << streams::setw(8) << sensors.accel.z << "\r\n";
output << streams::setw(6) << "GYR_X" << " |" << streams::setw(8) << gyro.x  << " |" << streams::setw(8) << sensors.gyro.x  << "\r\n";
output << streams::setw(6) << "GYR_Y" << " |" << streams::setw(8) << gyro.y  << " |" << streams::setw(8) << sensors.gyro.y  << "\r\n";
output << streams::setw(6) << "GYR_Z" << " |" << streams::setw(8) << gyro.z  << " |" << streams::setw(8) << sensors.gyro.z  << "\r\n";

I would expect the acceleration and gyroscope measurements to be very similar between these three calls (i.e. that sensors.accel.x be very close to accel.x and so on), but instead I get this:

   var |    sep. |   comb.
 ACC_X |    1800 |     -21
 ACC_Y |     -60 |    -164
 ACC_Z |  -16288 |     -20
 GYR_X |     -16 |    1728
 GYR_Y |    -170 |    -148
 GYR_Z |     -30 |  -16364

It looks to me like the driver is reading the gryo and acceleration data in the wrong order.

Refactor and improve sonar API

FastArduino 1.0 sonar API has the following flaws:

  • does not support timeout in asynchronous mode
  • requires its own timer
    It should be improved to:
  • use RTT instead of Timer (an RTT can be shared across the whole program)
  • support timeout in asynchronous mode
  • increase performance of ISR callbacks (defer calculation outside ISR)

Document API of supported devices

Currently FastArduino provides specific support to several external devices (e.g. SIPO chips, Buzzers, Servo, Magnetometer, Accelerometers...)

Since support of these devices is part of FastArduino project, all relevant API should be documented with doxygen, the same way as FastArduino core API.

Document how to add support for a new board or MCU

FastArduino currently supports several boards and Atmel AVR MCU, but makers may use other AVR-based boards or other MCUs.

Documenting how to add support for new a new board or MCU would ease FastArduino adoption by covering more possible configurations.

Documentation would explain:

  • which header files to create and how
  • what header files should be modified
  • how to modify FastArduino makefiles
  • how to adapt examples for a new board

Finish core API documentation

Today, FastArduino core API is mostly documented with doxygen and doc made available here.

However, there are still a few header files without API documentation:

  • pulse_timer.h
  • soft_uart.h
  • square_wave.h

Benchmarks

@jfpoilpret This was a nice project you have started. I was looking for some benchmarks to support your claims on the README page. Are there any? Or is this just from "experience"?

IOS errors not always visible in `rdstate()`

FastArduino example iostreams3 demonstrates this issue:
ios.rdstate() is 0 in case of:

  • buffer overflow
  • maybe other error conditions (to be verified individually)

Note: incorrect input formatting (failbit) is correctly transmitted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.