Skip to content

Commit 8cf0f6b

Browse files
authored
Merge pull request #1 from siwiembedded/develop
siwigsm platform release v0.2.0
2 parents a966e4e + 47a7387 commit 8cf0f6b

File tree

19 files changed

+735
-9
lines changed

19 files changed

+735
-9
lines changed

builder/framework/siwisdk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
# Create Project Template
2121
main_c = join(env.subst("$PROJECT_DIR"), "src", "main.c")
22-
if False == isfile(main_c):
22+
main_cpp = join(env.subst("$PROJECT_DIR"), "src", "main.cpp")
23+
if (False == isfile(main_c)) and (False == isfile(main_cpp)):
2324
copyfile(join(FRAMEWORK_DIR, "template", "main.c"), main_c)
2425

2526
def fota_crc16(data:bytearray, length):
@@ -115,6 +116,9 @@ def gen_fota_file(target, source, env):
115116
"-Wall",
116117
"-mthumb",
117118
"-mthumb-interwork",
119+
],
120+
121+
CFLAGS=[
118122
"-std=gnu11"
119123
],
120124

builder/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
SIWIFLASHER=join(platform.get_package_dir(
3737
"tool-siwiflasher") or "", "siwiflasher"),
3838
REFLASH_FLAGS=[
39-
"-r"
39+
"-r",
40+
"-b", "$UPLOAD_SPEED",
41+
"-p", '"$UPLOAD_PORT"',
4042
],
4143
REFLASH_CMD='"$SIWIFLASHER" $REFLASH_FLAGS'
4244
)

examples/adc-example/readme.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,57 @@ How to build
2121
2222
# Upload Project
2323
$ platformio run --target upload
24+
25+
Example Output
26+
--------------
27+
28+
.. code-block::
29+
30+
(c) 2020 SiWi
31+
Firmware Lib v6.49 0b5247c - Build Jun 7 2020 14:10:11
32+
Core firmware: SC20UCB01A02_SIWI_759fd68
33+
System Ready
34+
System Initialization finished
35+
SYSTEM: GSM NW State: 2
36+
NETWORK: SIM card ready
37+
______ _ _ _ _ _
38+
/ _____|_|_)(_)(_|_)
39+
( (____ _ _ _ _ _
40+
\____ \| | || || | |
41+
_____) ) | || || | |
42+
(______/|_|\_____/|_|
43+
44+
45+
Please login to access console
46+
Username: ADC Channel 0: 572, 1565.56mV
47+
ADC Channel 1: 932, 2550.88mV
48+
ADC Channel 2: 13, 35.58mV
49+
ADC Channel 0: 571, 1562.83mV
50+
ADC Channel 1: 932, 2550.88mV
51+
ADC Channel 2: 12, 32.84mV
52+
ADC Channel 0: 573, 1568.30mV
53+
ADC Channel 1: 931, 2548.15mV
54+
ADC Channel 2: 13, 35.58mV
55+
ADC Channel 0: 572, 1565.56mV
56+
ADC Channel 1: 931, 2548.15mV
57+
ADC Channel 2: 13, 35.58mV
58+
ADC Channel 0: 571, 1562.83mV
59+
ADC Channel 1: 931, 2548.15mV
60+
ADC Channel 2: 12, 32.84mV
61+
SYSTEM: GSM NW State: 5
62+
ADC Channel 0: 572, 1565.56mV
63+
ADC Channel 1: 932, 2550.88mV
64+
ADC Channel 2: 12, 32.84mV
65+
NETWORK: GSM - Registered
66+
ADC Channel 0: 571, 1562.83mV
67+
ADC Channel 1: 932, 2550.88mV
68+
ADC Channel 2: 13, 35.58mV
69+
ADC Channel 0: 570, 1560.09mV
70+
ADC Channel 1: 931, 2548.15mV
71+
ADC Channel 2: 13, 35.58mV
72+
ADC Channel 0: 572, 1565.56mV
73+
ADC Channel 1: 932, 2550.88mV
74+
ADC Channel 2: 13, 35.58mV
75+
ADC Channel 0: 571, 1562.83mV
76+
ADC Channel 1: 932, 2550.88mV
77+
ADC Channel 2: 13, 35.58mV

examples/adc-example/src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void adc_task(void *arg)
135135
/**
136136
* Application main entry point
137137
*/
138-
void user_main(void)
138+
int main(int argc, char *argv[])
139139
{
140140
/*
141141
* Initialize library and Setup STDIO
@@ -148,4 +148,9 @@ void user_main(void)
148148
os_create_task(adc_task, NULL, FALSE);
149149

150150
printf("System Initialization finished\n");
151+
152+
while (1) {
153+
/* main task loop */
154+
sleep(1);
155+
}
151156
}

examples/gpio-blink/readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ How to build
2121
2222
# Upload Project
2323
$ platformio run --target upload
24+

examples/gpio-blink/src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void gpio_blink_task(void *arg)
137137
/**
138138
* Application main entry point
139139
*/
140-
void user_main(void)
140+
int main(int argc, char *argv[])
141141
{
142142
/*
143143
* Initialize library and Setup STDIO
@@ -150,4 +150,8 @@ void user_main(void)
150150
os_create_task(gpio_blink_task, NULL, FALSE);
151151

152152
printf("System Initialization finished\n");
153+
154+
while (1) {
155+
sleep(1);
156+
}
153157
}

examples/socket-example/readme.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,46 @@ How to build
2121
2222
# Upload Project
2323
$ platformio run --target upload
24+
25+
Example Output
26+
--------------
27+
28+
.. code-block::
29+
30+
(c) 2020 SiWi
31+
Firmware Lib v6.49 0b5247c - Build Jun 7 2020 14:10:11
32+
Core firmware: SC20UCB01A02_SIWI_759fd68
33+
System Ready
34+
System Initialization finished
35+
SYSTEM: GSM NW State: 2
36+
NETWORK: SIM card ready
37+
______ _ _ _ _ _
38+
/ _____|_|_)(_)(_|_)
39+
( (____ _ _ _ _ _
40+
\____ \| | || || | |
41+
_____) ) | || || | |
42+
(______/|_|\_____/|_|
43+
44+
45+
Please login to access console
46+
Username: SYSTEM: GSM NW State: 5
47+
NETWORK: GSM - Registered
48+
NETWORK: GPRS - Registered
49+
NETWORK: GPRS Active 1110
50+
Socket connected
51+
Data received (12 bytes):
52+
Hello World
53+
Data send status: 0
54+
Data received (12 bytes):
55+
Hello World
56+
Data send status: 0
57+
Data send status: 0
58+
Data received (12 bytes):
59+
Hello World
60+
Data received (12 bytes):
61+
Hello World
62+
Data send status: 0
63+
Data received (12 bytes):
64+
Hello World
65+
Data send status: 0
66+

examples/socket-example/src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void socket_task(void *arg)
187187
/**
188188
* Application main entry point
189189
*/
190-
void user_main(void)
190+
int main(int argc, char *argv[])
191191
{
192192
/*
193193
* Initialize library and Setup STDIO
@@ -203,4 +203,9 @@ void user_main(void)
203203
os_create_task(socket_task, NULL, FALSE);
204204

205205
printf("System Initialization finished\n");
206+
207+
while (1) {
208+
/* Main task loop */
209+
sleep(1);
210+
}
206211
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.pio
2+
.vscode/.browse.c_cpp.db*
3+
.vscode/c_cpp_properties.json
4+
.vscode/launch.json
5+
.vscode/ipch
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Continuous Integration (CI) is the practice, in software
2+
# engineering, of merging all developer working copies with a shared mainline
3+
# several times a day < https://docs.platformio.org/page/ci/index.html >
4+
#
5+
# Documentation:
6+
#
7+
# * Travis CI Embedded Builds with PlatformIO
8+
# < https://docs.travis-ci.com/user/integration/platformio/ >
9+
#
10+
# * PlatformIO integration with Travis CI
11+
# < https://docs.platformio.org/page/ci/travis.html >
12+
#
13+
# * User Guide for `platformio ci` command
14+
# < https://docs.platformio.org/page/userguide/cmd_ci.html >
15+
#
16+
#
17+
# Please choose one of the following templates (proposed below) and uncomment
18+
# it (remove "# " before each line) or use own configuration according to the
19+
# Travis CI documentation (see above).
20+
#
21+
22+
23+
#
24+
# Template #1: General project. Test it using existing `platformio.ini`.
25+
#
26+
27+
# language: python
28+
# python:
29+
# - "2.7"
30+
#
31+
# sudo: false
32+
# cache:
33+
# directories:
34+
# - "~/.platformio"
35+
#
36+
# install:
37+
# - pip install -U platformio
38+
# - platformio update
39+
#
40+
# script:
41+
# - platformio run
42+
43+
44+
#
45+
# Template #2: The project is intended to be used as a library with examples.
46+
#
47+
48+
# language: python
49+
# python:
50+
# - "2.7"
51+
#
52+
# sudo: false
53+
# cache:
54+
# directories:
55+
# - "~/.platformio"
56+
#
57+
# env:
58+
# - PLATFORMIO_CI_SRC=path/to/test/file.c
59+
# - PLATFORMIO_CI_SRC=examples/file.ino
60+
# - PLATFORMIO_CI_SRC=path/to/test/directory
61+
#
62+
# install:
63+
# - pip install -U platformio
64+
# - platformio update
65+
#
66+
# script:
67+
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N

0 commit comments

Comments
 (0)