Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
2764a8ee
Commit
2764a8ee
authored
Apr 18, 2015
by
Damien George
Browse files
stmhal: Remove std.h. It's not needed anymore.
parent
f53a8e71
Changes
3
Hide whitespace changes
Inline
Side-by-side
drivers/cc3000/src/inet_ntop.c
View file @
2764a8ee
...
...
@@ -15,12 +15,16 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include
<std.h>
#include
<string.h>
#include
"cc3000_common.h"
#include
"socket.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 INADDRSZ 4
#define INT16SZ 2
...
...
stmhal/modnwcc3k.c
View file @
2764a8ee
...
...
@@ -24,10 +24,6 @@
* 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
<stdarg.h>
#include
<errno.h>
...
...
@@ -531,9 +527,9 @@ STATIC mp_obj_t cc3k_ifconfig(mp_obj_t self_in) {
mod_network_convert_ipv4_endianness
(
ipconfig
.
aucDHCPServer
);
// render MAC address
char
mac_str
[
18
]
;
VSTR_FIXED
(
mac_
v
str
,
18
)
;
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
mp_obj_t
tuple
[
7
]
=
{
...
...
@@ -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
.
aucDNSServer
),
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
),
};
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) {
if
(
key
[
0
]
==
'p'
&&
key
[
1
]
==
'g'
&&
key
[
2
]
==
'm'
&&
key
[
3
]
==
'\0'
)
{
patch_prog_start
();
}
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
;
}
...
...
stmhal/std.h
deleted
100644 → 0
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
,
...);
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment