|
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Go to the documentation of this file.
48 : m_printer(&printer),
67 return -1 != this->m_lock;
99 this->m_borrowed =
true;
100 return this->m_printer;
107 if (printer == this->m_printer) {
109 this->m_borrowed =
false;
121 this->m_printer->
print(var);
132 this->m_printer->
println(
string);
141 this->m_printer->
puts(fmt);
148 template<
typename T,
typename... Targs>
149 void printf (
const char fmt[],
const T first,
const Targs... remaining)
const {
151 this->m_printer->
printf(fmt, first, remaining...);
const PropWare::SynchronousPrinter pwSyncOut
Global and shared instance for easy printing to the terminal (thread safe)
bool has_lock() const
Determine if an instance of a SynchronousPrinter successfully retrieved a lock.
void printf(const char fmt[], const T first, const Targs... remaining) const
Similar in functionality to the C-standard function printf.
bool refreshLock()
Retrieve a new lock.
~SynchronousPrinter()
Ensure that, when a SynchronousPrinter is no longer being used, the lock is returned.
void print(const T var) const
void printf(const char fmt[]) const
SynchronousPrinter(const Printer &printer)
Creates a synchronous instance of a Printer that can be used from multiple cogs simultaneously.
const Printer * borrow_printer()
Retrieve the printer and acquire the lock. Useful when a class that only supports Printer and not Syn...
#define lockset(lockid)
Set a lock.
#define lockret(lockid)
Return lock to pool.
void print(const char c, const Format &format=DEFAULT_FORMAT) const
Print a single character.
#define lockclr(lockid)
Clear lock.
bool return_printer(const Printer *printer)
After calling SynchronousPrinter::borrow_printer, this method.
#define locknew()
Get a new lock from the pool of Propeller hardware locks.
void println(const char string[]) const
Print a string along with a newline at the end.
void printf(const char fmt[], const T first, const Targs... remaining) const
Print formatted text to a serial terminal, an LCD, or any other device from any cog at any time with ...
void puts(const char string[]) const
Send a null-terminated character array.
Container class that has formatting methods for human-readable output. This class can be constructed ...
Generic definitions and functions for the Parallax Propeller.
void println(const char string[]) const
Print a null-terminated string followed by a newline (' ')