Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
2764a8ee
Commit
2764a8ee
authored
Apr 18, 2015
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stmhal: Remove std.h. It's not needed anymore.
parent
f53a8e71
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
drivers/cc3000/src/inet_ntop.c
+5
-1
5 additions, 1 deletion
drivers/cc3000/src/inet_ntop.c
stmhal/modnwcc3k.c
+4
-8
4 additions, 8 deletions
stmhal/modnwcc3k.c
stmhal/std.h
+0
-42
0 additions, 42 deletions
stmhal/std.h
with
9 additions
and
51 deletions
drivers/cc3000/src/inet_ntop.c
+
5
−
1
View file @
2764a8ee
...
@@ -15,12 +15,16 @@
...
@@ -15,12 +15,16 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
*/
#include
<std.h>
#include
<string.h>
#include
<string.h>
#include
"cc3000_common.h"
#include
"cc3000_common.h"
#include
"socket.h"
#include
"socket.h"
#include
"inet_ntop.h"
#include
"inet_ntop.h"
// We can't include stdio.h because it defines _types_fd_set, but we
// need to use the CC3000 version of this type. So we must provide
// our own declaration of snprintf. Grrr.
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
fmt
,
...);
#define IN6ADDRSZ 16
#define IN6ADDRSZ 16
#define INADDRSZ 4
#define INADDRSZ 4
#define INT16SZ 2
#define INT16SZ 2
...
...
This diff is collapsed.
Click to expand it.
stmhal/modnwcc3k.c
+
4
−
8
View file @
2764a8ee
...
@@ -24,10 +24,6 @@
...
@@ -24,10 +24,6 @@
* THE SOFTWARE.
* THE SOFTWARE.
*/
*/
// We can't include stdio.h because it defines _types_fd_set, but we
// need to use the CC3000 version of this type.
#include
<std.h>
#include
<string.h>
#include
<string.h>
#include
<stdarg.h>
#include
<stdarg.h>
#include
<errno.h>
#include
<errno.h>
...
@@ -531,9 +527,9 @@ STATIC mp_obj_t cc3k_ifconfig(mp_obj_t self_in) {
...
@@ -531,9 +527,9 @@ STATIC mp_obj_t cc3k_ifconfig(mp_obj_t self_in) {
mod_network_convert_ipv4_endianness
(
ipconfig
.
aucDHCPServer
);
mod_network_convert_ipv4_endianness
(
ipconfig
.
aucDHCPServer
);
// render MAC address
// render MAC address
char
mac_str
[
18
]
;
VSTR_FIXED
(
mac_
v
str
,
18
)
;
const
uint8_t
*
mac
=
ipconfig
.
uaMacAddr
;
const
uint8_t
*
mac
=
ipconfig
.
uaMacAddr
;
mp_uint_t
mac_len
=
sn
printf
(
mac_str
,
18
,
"%02
X
:%02x:%02x:%02x:%02x:%02x"
,
mac
[
5
],
mac
[
4
],
mac
[
3
],
mac
[
2
],
mac
[
1
],
mac
[
0
]);
vstr_
printf
(
&
mac_
v
str
,
"%02
x
:%02x:%02x:%02x:%02x:%02x"
,
mac
[
5
],
mac
[
4
],
mac
[
3
],
mac
[
2
],
mac
[
1
],
mac
[
0
]);
// create and return tuple with ifconfig info
// create and return tuple with ifconfig info
mp_obj_t
tuple
[
7
]
=
{
mp_obj_t
tuple
[
7
]
=
{
...
@@ -542,7 +538,7 @@ STATIC mp_obj_t cc3k_ifconfig(mp_obj_t self_in) {
...
@@ -542,7 +538,7 @@ STATIC mp_obj_t cc3k_ifconfig(mp_obj_t self_in) {
mod_network_format_ipv4_addr
(
ipconfig
.
aucDefaultGateway
),
mod_network_format_ipv4_addr
(
ipconfig
.
aucDefaultGateway
),
mod_network_format_ipv4_addr
(
ipconfig
.
aucDNSServer
),
mod_network_format_ipv4_addr
(
ipconfig
.
aucDNSServer
),
mod_network_format_ipv4_addr
(
ipconfig
.
aucDHCPServer
),
mod_network_format_ipv4_addr
(
ipconfig
.
aucDHCPServer
),
mp_obj_new_str
(
mac_str
,
mac_len
,
false
),
mp_obj_new_str
(
mac_
v
str
.
buf
,
mac_
vstr
.
len
,
false
),
mp_obj_new_str
((
const
char
*
)
ipconfig
.
uaSSID
,
strlen
((
const
char
*
)
ipconfig
.
uaSSID
),
false
),
mp_obj_new_str
((
const
char
*
)
ipconfig
.
uaSSID
,
strlen
((
const
char
*
)
ipconfig
.
uaSSID
),
false
),
};
};
return
mp_obj_new_tuple
(
MP_ARRAY_SIZE
(
tuple
),
tuple
);
return
mp_obj_new_tuple
(
MP_ARRAY_SIZE
(
tuple
),
tuple
);
...
@@ -566,7 +562,7 @@ STATIC mp_obj_t cc3k_patch_program(mp_obj_t self_in, mp_obj_t key_in) {
...
@@ -566,7 +562,7 @@ STATIC mp_obj_t cc3k_patch_program(mp_obj_t self_in, mp_obj_t key_in) {
if
(
key
[
0
]
==
'p'
&&
key
[
1
]
==
'g'
&&
key
[
2
]
==
'm'
&&
key
[
3
]
==
'\0'
)
{
if
(
key
[
0
]
==
'p'
&&
key
[
1
]
==
'g'
&&
key
[
2
]
==
'm'
&&
key
[
3
]
==
'\0'
)
{
patch_prog_start
();
patch_prog_start
();
}
else
{
}
else
{
print
f
(
"pass 'pgm' as argument in order to program
\n
"
);
mp_
print
_str
(
&
mp_plat_print
,
"pass 'pgm' as argument in order to program
\n
"
);
}
}
return
mp_const_none
;
return
mp_const_none
;
}
}
...
...
This diff is collapsed.
Click to expand it.
stmhal/std.h
deleted
100644 → 0
+
0
−
42
View file @
f53a8e71
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2013, 2014 Damien P. George
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
typedef
unsigned
int
size_t
;
void
*
memcpy
(
void
*
dest
,
const
void
*
src
,
size_t
n
);
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
size_t
n
);
void
*
memset
(
void
*
s
,
int
c
,
size_t
n
);
size_t
strlen
(
const
char
*
str
);
int
strcmp
(
const
char
*
s1
,
const
char
*
s2
);
int
strncmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
);
char
*
strcpy
(
char
*
dest
,
const
char
*
src
);
char
*
strcat
(
char
*
dest
,
const
char
*
src
);
char
*
strchr
(
const
char
*
s
,
int
c
);
char
*
strstr
(
const
char
*
haystack
,
const
char
*
needle
);
int
printf
(
const
char
*
fmt
,
...);
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
fmt
,
...);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment