diff --git a/apps/powertrace/powertrace.c b/apps/powertrace/powertrace.c index 66b469afe..fcbdffa84 100644 --- a/apps/powertrace/powertrace.c +++ b/apps/powertrace/powertrace.c @@ -293,7 +293,7 @@ input_printsniffer(void) } /*---------------------------------------------------------------------------*/ static void -output_printsniffer(void) +output_printsniffer(int mac_status) { static int seqno = 0; sniffprint("O", seqno++); diff --git a/apps/shell/shell-rime-sniff.c b/apps/shell/shell-rime-sniff.c index 277ce26da..aa2d9cf75 100644 --- a/apps/shell/shell-rime-sniff.c +++ b/apps/shell/shell-rime-sniff.c @@ -114,7 +114,7 @@ input_sniffer(void) } /*---------------------------------------------------------------------------*/ static void -output_sniffer(void) +output_sniffer(int mac_status) { if(sniff_for_attributes) { sniff_attributes_output(SNIFFER_ATTRIBUTES_OUTPUT); diff --git a/core/net/mac/contikimac.c b/core/net/mac/contikimac.c index 82c027b07..af4fce07e 100644 --- a/core/net/mac/contikimac.c +++ b/core/net/mac/contikimac.c @@ -633,35 +633,35 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr) } packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1); - if(WITH_CONTIKIMAC_HEADER) { - hdrlen = packetbuf_totlen(); - if(packetbuf_hdralloc(sizeof(struct hdr)) == 0) { - /* Failed to allocate space for contikimac header */ - PRINTF("contikimac: send failed, too large header\n"); - return MAC_TX_ERR_FATAL; - } - chdr = packetbuf_hdrptr(); - chdr->id = CONTIKIMAC_ID; - chdr->len = hdrlen; - - /* Create the MAC header for the data packet. */ - hdrlen = NETSTACK_FRAMER.create(); - if(hdrlen == 0) { - /* Failed to send */ - PRINTF("contikimac: send failed, too large header\n"); - packetbuf_hdr_remove(sizeof(struct hdr)); - return MAC_TX_ERR_FATAL; - } - hdrlen += sizeof(struct hdr); - } else { - /* Create the MAC header for the data packet. */ - hdrlen = NETSTACK_FRAMER.create(); - if(hdrlen == 0) { - /* Failed to send */ - PRINTF("contikimac: send failed, too large header\n"); - return MAC_TX_ERR_FATAL; - } +#if WITH_CONTIKIMAC_HEADER + hdrlen = packetbuf_totlen(); + if(packetbuf_hdralloc(sizeof(struct hdr)) == 0) { + /* Failed to allocate space for contikimac header */ + PRINTF("contikimac: send failed, too large header\n"); + return MAC_TX_ERR_FATAL; } + chdr = packetbuf_hdrptr(); + chdr->id = CONTIKIMAC_ID; + chdr->len = hdrlen; + + /* Create the MAC header for the data packet. */ + hdrlen = NETSTACK_FRAMER.create(); + if(hdrlen == 0) { + /* Failed to send */ + PRINTF("contikimac: send failed, too large header\n"); + packetbuf_hdr_remove(sizeof(struct hdr)); + return MAC_TX_ERR_FATAL; + } + hdrlen += sizeof(struct hdr); +#else + /* Create the MAC header for the data packet. */ + hdrlen = NETSTACK_FRAMER.create(); + if(hdrlen == 0) { + /* Failed to send */ + PRINTF("contikimac: send failed, too large header\n"); + return MAC_TX_ERR_FATAL; + } +#endif /* Make sure that the packet is longer or equal to the shortest diff --git a/cpu/stm32w108/Makefile.stm32w108 b/cpu/stm32w108/Makefile.stm32w108 index 1f27653a1..494de3a31 100644 --- a/cpu/stm32w108/Makefile.stm32w108 +++ b/cpu/stm32w108/Makefile.stm32w108 @@ -163,13 +163,12 @@ endif - -FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/linux/stm32w_flasher +FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/stm32w_flasher # Check if we are running under Windows ifdef OS ifneq (,$(findstring Windows,$(OS))) - FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/win/stm32w_flasher + FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/stm32w_flasher.exe endif endif diff --git a/examples/rime/example-meshconn.c b/examples/rime/example-meshconn.c deleted file mode 100644 index c46d393ec..000000000 --- a/examples/rime/example-meshconn.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2007, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * $Id: example-meshconn.c,v 1.3 2010/01/14 14:32:22 joxe Exp $ - */ - -/** - * \file - * A brief description of what this file is. - * \author - * Adam Dunkels - */ - -#include "contiki.h" -#include "net/rime.h" -#include "net/rime/meshconn.h" - -#include "dev/button-sensor.h" - -#include "dev/leds.h" - -#include - -static struct meshconn_conn meshconn; -/*---------------------------------------------------------------------------*/ -PROCESS(test_meshconn_process, "Meshconnconn test"); -AUTOSTART_PROCESSES(&test_meshconn_process); -/*---------------------------------------------------------------------------*/ -static void -connected(struct meshconn_conn *c) -{ - printf("connected\n"); -} -static void -closed(struct meshconn_conn *c) -{ - printf("closed\n"); -} -static void -reset(struct meshconn_conn *c) -{ - printf("reset\n"); -} -static void -timedout(struct meshconn_conn *c) -{ - printf("timedout\n"); -} -static void -recv(struct meshconn_conn *c) -{ - printf("Data received from %.*s (%d)\n", - packetbuf_datalen(), (char *)packetbuf_dataptr(), packetbuf_datalen()); - - /* meshconn_send(&meshconn, from);*/ -} - -const static struct meshconn_callbacks callbacks = { connected, - recv, - closed, - timedout, - reset }; -/*---------------------------------------------------------------------------*/ -PROCESS_THREAD(test_meshconn_process, ev, data) -{ - PROCESS_EXITHANDLER(meshconn_close(&meshconn);) - PROCESS_BEGIN(); - - meshconn_open(&meshconn, 128, &callbacks); - - while(1) { - rimeaddr_t addr; - static struct etimer et; - - etimer_set(&et, CLOCK_SECOND * 4); - PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et) || - (ev == sensors_event && data == &button_sensor)); - - printf("Button\n"); - - /* - * Send a message containing "Hej" (3 characters) to node number - * 6. - */ - - addr.u8[0] = 53; - addr.u8[1] = 0; - meshconn_connect(&meshconn, addr); - - packetbuf_copyfrom("Hej", 3); - meshconn_send(&meshconn, &addr); - } - PROCESS_END(); -} -/*---------------------------------------------------------------------------*/ diff --git a/platform/msb430/apps/acc-test.c b/platform/msb430/apps/acc-test.c index 17438afd2..fe5be0ab8 100644 --- a/platform/msb430/apps/acc-test.c +++ b/platform/msb430/apps/acc-test.c @@ -33,8 +33,9 @@ #include "contiki.h" #include "net/rime.h" -#include "dev/sd/sd.h" +#include "dev/sd.h" +#include #include /*---------------------------------------------------------------------------*/ diff --git a/platform/msb430/dev/sd-arch.c b/platform/msb430/dev/sd-arch.c index 02f5666f0..c3a2d8160 100644 --- a/platform/msb430/dev/sd-arch.c +++ b/platform/msb430/dev/sd-arch.c @@ -40,6 +40,7 @@ #include "contiki.h" #include "msb430-uart1.h" #include "sd-arch.h" +#include #define SPI_IDLE 0xff diff --git a/platform/msb430/dev/sd.c b/platform/msb430/dev/sd.c index b1ef4c21b..408659642 100644 --- a/platform/msb430/dev/sd.c +++ b/platform/msb430/dev/sd.c @@ -41,6 +41,7 @@ #include "sd.h" #include "sd-arch.h" +#include #include #define DEBUG 0 diff --git a/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin b/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin new file mode 100644 index 000000000..9548d9c26 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin differ diff --git a/tools/stm32w/stm32w_flasher/win/FTD2XX.dll b/tools/stm32w/stm32w_flasher/FTD2XX.dll similarity index 100% rename from tools/stm32w/stm32w_flasher/win/FTD2XX.dll rename to tools/stm32w/stm32w_flasher/FTD2XX.dll diff --git a/tools/stm32w/stm32w_flasher/JlinkARM.DLL b/tools/stm32w/stm32w_flasher/JlinkARM.DLL new file mode 100644 index 000000000..e3495631d Binary files /dev/null and b/tools/stm32w/stm32w_flasher/JlinkARM.DLL differ diff --git a/tools/stm32w/stm32w_flasher/README b/tools/stm32w/stm32w_flasher/README new file mode 100644 index 000000000..9eeb8c654 --- /dev/null +++ b/tools/stm32w/stm32w_flasher/README @@ -0,0 +1,26 @@ +STM32W Flasher 2.0.0b2 for Linux + +A programmer for development boards based on STM32W108 microcontroller. +It works with the following boards (with FT232R or STM32F103 as USB-serial converter): +MB850, MB851, MB950, MB951, MB954 + + +- Installation + + Installation is not required. + Hal package has to be present in your system. + + +- Usage + + Run the program with -h option for usage info. + + +- Notes + + This program may require root privileges when programming boards with + FT232R chip. + In Ubuntu, if you want to flash using Make, type 'sudo -s' before that. + + This version of STM32W Flasher does not support jlink yet. + diff --git a/tools/stm32w/stm32w_flasher/_ctypes.pyd b/tools/stm32w/stm32w_flasher/_ctypes.pyd new file mode 100644 index 000000000..8eb8847f1 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_ctypes.pyd differ diff --git a/tools/stm32w/stm32w_flasher/_socket.pyd b/tools/stm32w/stm32w_flasher/_socket.pyd new file mode 100644 index 000000000..ef1aab213 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_socket.pyd differ diff --git a/tools/stm32w/stm32w_flasher/_ssl.pyd b/tools/stm32w/stm32w_flasher/_ssl.pyd new file mode 100644 index 000000000..01a9c6033 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_ssl.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/bz2.pyd b/tools/stm32w/stm32w_flasher/bz2.pyd similarity index 68% rename from tools/stm32w/stm32w_flasher/win/bz2.pyd rename to tools/stm32w/stm32w_flasher/bz2.pyd index 7ab1cbb6e..3879840e0 100644 Binary files a/tools/stm32w/stm32w_flasher/win/bz2.pyd and b/tools/stm32w/stm32w_flasher/bz2.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/d2xx._d2xx.pyd b/tools/stm32w/stm32w_flasher/d2xx._d2xx.pyd similarity index 100% rename from tools/stm32w/stm32w_flasher/win/d2xx._d2xx.pyd rename to tools/stm32w/stm32w_flasher/d2xx._d2xx.pyd diff --git a/tools/stm32w/stm32w_flasher/linux/README b/tools/stm32w/stm32w_flasher/linux/README deleted file mode 100644 index 3c4a0844a..000000000 --- a/tools/stm32w/stm32w_flasher/linux/README +++ /dev/null @@ -1,22 +0,0 @@ -STM32W Flasher 1.1.0b1 for Linux - -A programmer for MB851 development boards based on STM32W108 microcontroller. - -- Installation - - Installation is not required. - Hal package has to be present in your system. - - -- Usage - - Run the program with -h option for usage info. - - -- Notes - - This program may require root privileges. - In Ubuntu, if you want to flash using Make, type 'sudo -s' before that. - - This version of STM32W Flasher does not support jlink yet. - diff --git a/tools/stm32w/stm32w_flasher/linux/stm32w_flasher b/tools/stm32w/stm32w_flasher/linux/stm32w_flasher deleted file mode 100644 index 42d38d681..000000000 Binary files a/tools/stm32w/stm32w_flasher/linux/stm32w_flasher and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/main_rfbl.s37 b/tools/stm32w/stm32w_flasher/main_rfbl.s37 new file mode 100644 index 000000000..9a2f6ea11 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/main_rfbl.s37 differ diff --git a/tools/stm32w/stm32w_flasher/pyexpat.pyd b/tools/stm32w/stm32w_flasher/pyexpat.pyd new file mode 100644 index 000000000..4857c0479 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/pyexpat.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/python26.dll b/tools/stm32w/stm32w_flasher/python26.dll similarity index 51% rename from tools/stm32w/stm32w_flasher/win/python26.dll rename to tools/stm32w/stm32w_flasher/python26.dll index 16b929681..d3533b542 100644 Binary files a/tools/stm32w/stm32w_flasher/win/python26.dll and b/tools/stm32w/stm32w_flasher/python26.dll differ diff --git a/tools/stm32w/stm32w_flasher/win/pywintypes26.dll b/tools/stm32w/stm32w_flasher/pywintypes26.dll similarity index 100% rename from tools/stm32w/stm32w_flasher/win/pywintypes26.dll rename to tools/stm32w/stm32w_flasher/pywintypes26.dll diff --git a/tools/stm32w/stm32w_flasher/select.pyd b/tools/stm32w/stm32w_flasher/select.pyd new file mode 100644 index 000000000..2b90ceadc Binary files /dev/null and b/tools/stm32w/stm32w_flasher/select.pyd differ diff --git a/tools/stm32w/stm32w_flasher/stm32w_flasher b/tools/stm32w/stm32w_flasher/stm32w_flasher new file mode 100755 index 000000000..883f9d60a Binary files /dev/null and b/tools/stm32w/stm32w_flasher/stm32w_flasher differ diff --git a/tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe b/tools/stm32w/stm32w_flasher/stm32w_flasher.exe similarity index 77% rename from tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe rename to tools/stm32w/stm32w_flasher/stm32w_flasher.exe index b3c5096ce..21ce02820 100644 Binary files a/tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe and b/tools/stm32w/stm32w_flasher/stm32w_flasher.exe differ diff --git a/tools/stm32w/stm32w_flasher/win/unicodedata.pyd b/tools/stm32w/stm32w_flasher/unicodedata.pyd similarity index 99% rename from tools/stm32w/stm32w_flasher/win/unicodedata.pyd rename to tools/stm32w/stm32w_flasher/unicodedata.pyd index 4e4632535..18a996f55 100644 Binary files a/tools/stm32w/stm32w_flasher/win/unicodedata.pyd and b/tools/stm32w/stm32w_flasher/unicodedata.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/w9xpopen.exe b/tools/stm32w/stm32w_flasher/w9xpopen.exe similarity index 99% rename from tools/stm32w/stm32w_flasher/win/w9xpopen.exe rename to tools/stm32w/stm32w_flasher/w9xpopen.exe index 139f6dd1d..233538ff7 100644 Binary files a/tools/stm32w/stm32w_flasher/win/w9xpopen.exe and b/tools/stm32w/stm32w_flasher/w9xpopen.exe differ diff --git a/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL b/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL deleted file mode 100644 index aab92aa21..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_ctypes.pyd b/tools/stm32w/stm32w_flasher/win/_ctypes.pyd deleted file mode 100644 index c7743c75f..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_ctypes.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_socket.pyd b/tools/stm32w/stm32w_flasher/win/_socket.pyd deleted file mode 100644 index 4d07b365d..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_socket.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_ssl.pyd b/tools/stm32w/stm32w_flasher/win/_ssl.pyd deleted file mode 100644 index f1c538f5e..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_ssl.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/select.pyd b/tools/stm32w/stm32w_flasher/win/select.pyd deleted file mode 100644 index 192197429..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/select.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/win32api.pyd b/tools/stm32w/stm32w_flasher/win32api.pyd similarity index 100% rename from tools/stm32w/stm32w_flasher/win/win32api.pyd rename to tools/stm32w/stm32w_flasher/win32api.pyd diff --git a/tools/stm32w/stm32w_flasher/win32pipe.pyd b/tools/stm32w/stm32w_flasher/win32pipe.pyd new file mode 100644 index 000000000..580809803 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/win32pipe.pyd differ diff --git a/tools/stm32w/wpcapslip6/wpcapslip6.c b/tools/stm32w/wpcapslip6/wpcapslip6.c index 730ec3a26..a0f22ce65 100755 --- a/tools/stm32w/wpcapslip6/wpcapslip6.c +++ b/tools/stm32w/wpcapslip6/wpcapslip6.c @@ -938,7 +938,7 @@ bool validIPAddr(const char * ip_addr, int prefix_len) char tmp_addr[INET6_ADDRSTRLEN], tmp2_addr[INET6_ADDRSTRLEN]; char * substr; - strncpy(tmp_addr, br_prefix, INET6_ADDRSTRLEN); + strncpy(tmp_addr, ip_addr, INET6_ADDRSTRLEN); strtok(tmp_addr,"/"); @@ -985,7 +985,7 @@ main(int argc, char **argv) osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osVersionInfo); - while((c = getopt(argc, argv, "B:D:hs:c:ra:p:v:tb:")) != -1) { + while((c = getopt(argc, argv, "B:D:hs:c:ra:p:vtb:")) != -1) { switch (c) { case 'B': baudrate = atoi(optarg); diff --git a/tools/stm32w/wpcapslip6/wpcapslip6.exe b/tools/stm32w/wpcapslip6/wpcapslip6.exe index 84dbcc768..80fed7ae8 100755 Binary files a/tools/stm32w/wpcapslip6/wpcapslip6.exe and b/tools/stm32w/wpcapslip6/wpcapslip6.exe differ