PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
simple
simpleterm.c
1
/*
2
* @file SimpleTerm.c
3
* SimpleTerm startup default constructor
4
*
5
* Copyright (c) 2013, Parallax Inc.
6
* Written by Steve Denson
7
*/
8
#include <propeller.h>
9
#include "simpletext.h"
10
11
/*
12
* SimpleTerm uses global pointers for IO - it is the default debug module.
13
* Functions like putChar, putDec, putLine are default IO and use the globals.
14
* Removed confusing #ifdef. Startup delay moved from serial_open to here.
15
*/
16
HUBDATA
terminal
*dport_ptr = 0;
17
18
__attribute__((constructor))
19
terminal
*simpleterm_open(
void
)
20
{
21
if
(dport_ptr != 0)
22
return
dport_ptr;
23
24
dport_ptr = serial_open(31,30,0,115200);
25
waitcnt(CLKFREQ+CNT);
26
return
dport_ptr;
27
}
28
32
terminal
*simpleterm_pointer(
void
)
33
{
34
return
dport_ptr;
35
}
36
37
/*
38
+--------------------------------------------------------------------
39
| TERMS OF USE: MIT License
40
+--------------------------------------------------------------------
41
Permission is hereby granted, free of charge, to any person obtaining
42
a copy of this software and associated documentation files
43
(the "Software"), to deal in the Software without restriction,
44
including without limitation the rights to use, copy, modify, merge,
45
publish, distribute, sublicense, and/or sell copies of the Software,
46
and to permit persons to whom the Software is furnished to do so,
47
subject to the following conditions:
48
49
The above copyright notice and this permission notice shall be
50
included in all copies or substantial portions of the Software.
51
52
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
53
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
54
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
55
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
56
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
57
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
58
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59
+--------------------------------------------------------------------
60
*/
61
62
text_struct
Structure that contains data used by simple text device libraries.
Definition:
simpletext.h:70
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12