microbit: Removed print funcitons from matrix class due to SRAM overhead of

native printf() call.

The Matrix4::print() function is useful, but non essential for most
applications, and the underlying printf() call required cost an
additional 1K of RAM on first use, which is currently above the budget for
micro:bit.
This commit is contained in:
Joe Finney 2016-01-09 10:25:26 +00:00
parent d51b1205f7
commit 6916d506b8
2 changed files with 0 additions and 30 deletions

View file

@ -134,16 +134,6 @@ public:
*/
Matrix4 invert();
/**
* Prints this matrix to the console.
*
* Example:
* @code
* matrix.print();
* @endcode
*/
void print();
/**
* Destructor.
*/

View file

@ -237,26 +237,6 @@ Matrix4 Matrix4::invert()
return result;
}
/**
* Prints this matrix to the console.
*
* Example:
* @code
* matrix.print();
* @endcode
*/
void Matrix4::print()
{
for (int r = 0; r < height(); r++)
{
for (int c = 0; c < width(); c++)
{
uBit.serial.printf("%d\t", (int)get(r, c));
}
uBit.serial.printf("\n");
}
}
/**
* Destructor.
*/