summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-02-14 16:23:54 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-02-14 16:23:54 +0300
commit64916436b2b6ded6770cd58d3cb4f5382c2f7d1e (patch)
treeccf8e87f28ae9ea7afc0d9df3bbfb1b98e117cbc
parentee3615d80022d1b5e5c0fdca466f20e50f07e63c (diff)
downloadmicropython-64916436b2b6ded6770cd58d3cb4f5382c2f7d1e.tar.gz
micropython-64916436b2b6ded6770cd58d3cb4f5382c2f7d1e.zip
zephyr: Enable IPv6 networking in addition to IPv4.
-rw-r--r--zephyr/main.c9
-rw-r--r--zephyr/prj_base.conf3
2 files changed, 9 insertions, 3 deletions
diff --git a/zephyr/main.c b/zephyr/main.c
index 6d7fca8024..a11a6dbdab 100644
--- a/zephyr/main.c
+++ b/zephyr/main.c
@@ -67,11 +67,16 @@ static char *stack_top;
static char heap[MICROPY_HEAP_SIZE];
void init_zephyr(void) {
+ // TODO: Make addresses configurable
#ifdef CONFIG_NET_IPV4
- // TODO: Make address configurable
- static struct in_addr in4addr_my = { { { 192, 0, 2, 1 } } };
+ static struct in_addr in4addr_my = {{{192, 0, 2, 1}}};
net_if_ipv4_addr_add(net_if_get_default(), &in4addr_my, NET_ADDR_MANUAL, 0);
#endif
+ #ifdef CONFIG_NET_IPV6
+ // 2001:db8::1
+ static struct in6_addr in6addr_my = {{{0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}};
+ net_if_ipv6_addr_add(net_if_get_default(), &in6addr_my, NET_ADDR_MANUAL, 0);
+ #endif
}
int real_main(void) {
diff --git a/zephyr/prj_base.conf b/zephyr/prj_base.conf
index 43aedd8fec..295963023b 100644
--- a/zephyr/prj_base.conf
+++ b/zephyr/prj_base.conf
@@ -8,5 +8,6 @@ CONFIG_MAIN_STACK_SIZE=4096
# Networking config
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
+CONFIG_NET_IPV6=y
CONFIG_TEST_RANDOM_GENERATOR=y
-CONFIG_NET_NBUF_RX_COUNT=4
+CONFIG_NET_NBUF_RX_COUNT=5