rusEFI
The most advanced open source ECU
|
Buffered console output stream code.
Here we have a memory buffer and methods related to printing messages into this buffer. The purpose of the buffer is to allow fast, non-blocking, thread-safe logging.
The idea is that each interrupt handler would have it's own logging buffer. You can add stuff into this buffer without any locking since it's you own buffer, and once you get the whole message you invoke the scheduleLogging() method which appends your local content into the global logging buffer, from which it is later dispatched to the console by our main console thread.
This file is part of rusEfi - see http://rusefi.com
rusEfi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file datalogging.cpp.