PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
putDecDigits.c
1 /*
2  * @file putDecDigits.c
3  * Function to print a number of space padded width to the terminal.
4  *
5  * Copyright (c) 2013, Parallax Inc.
6  * Written by Steve Denson
7  */
8 #include "simpletext.h"
9 
10 void putDecLen(int val, int width)
11 {
12  extern text_t *dport_ptr;
13  if(val < 0) {
14  val = -val;
15  writeChar(dport_ptr, '-');
16  }
17  printNumber(dport_ptr, val, 10, width, '0');
18 }
19 
20 /*
21 +--------------------------------------------------------------------
22 | TERMS OF USE: MIT License
23 +--------------------------------------------------------------------
24 Permission is hereby granted, free of charge, to any person obtaining
25 a copy of this software and associated documentation files
26 (the "Software"), to deal in the Software without restriction,
27 including without limitation the rights to use, copy, modify, merge,
28 publish, distribute, sublicense, and/or sell copies of the Software,
29 and to permit persons to whom the Software is furnished to do so,
30 subject to the following conditions:
31 
32 The above copyright notice and this permission notice shall be
33 included in all copies or substantial portions of the Software.
34 
35 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
38 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
39 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
40 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
41 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 +--------------------------------------------------------------------
43 */
44 
putDecLen
void putDecLen(int value, int width)
Print string representation of a decimal number to the debug port.
Definition: putDecDigits.c:10
simpletext.h
This library provides a collection of functions for communicating with text devices such as SimpleIDE...
writeChar
void writeChar(text_t *device, char c)
Send a character to the device.
Definition: writeChar.c:11
text_struct
Structure that contains data used by simple text device libraries.
Definition: simpletext.h:81