author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
491,595 |
19.08.2018 08:13:16
| -7,200 |
23c3c49095c4adb6c5add6197acf0372a25e3499
|
add scum into scons build system.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -199,7 +199,7 @@ elif env['toolchain']=='iar-proj':\nelif env['toolchain']=='armgcc':\n- if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro']:\n+ if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro', 'scum']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\nif env['board'] in ['openmote-cc2538','openmote-b']:\n@@ -393,6 +393,45 @@ elif env['toolchain']=='armgcc':\nenv.Replace(NM = 'arm-none-eabi-nm')\nenv.Replace(SIZE = 'arm-none-eabi-size')\n+ elif env['board']=='scum':\n+\n+ # compiler (C)\n+ env.Replace(CC = 'arm-none-eabi-gcc')\n+ env.Append(CCFLAGS = '-O0')\n+ env.Append(CCFLAGS = '-Wall')\n+ env.Append(CCFLAGS = '-c')\n+ env.Append(CCFLAGS = '-fmessage-length=0')\n+ env.Append(CCFLAGS = '-mcpu=cortex-m0')\n+ env.Append(CCFLAGS = '-mthumb')\n+ env.Append(CCFLAGS = '-mthumb-interwork')\n+ env.Append(CCFLAGS = '-g3')\n+ env.Append(CCFLAGS = '-Wstrict-prototypes')\n+ env.Append(CCFLAGS = '-Ibsp/boards/scum')\n+ env.Append(CCFLAGS = '-std=c99')\n+ env.Append(CCFLAGS = '-nostartfiles')\n+ # assembler\n+ env.Replace(AS = 'arm-none-eabi-as')\n+ env.Append(ASFLAGS = '-ggdb -g3 -mcpu=cortex-m0 -mlittle-endian -mapcs-32')\n+ # linker\n+ env.Append(LINKFLAGS = '-Tbsp/boards/scum/scum_linker.ld')\n+ #env.Append(LINKFLAGS = '-nostartfiles')\n+ env.Append(LINKFLAGS = '-mcpu=cortex-m0')\n+ env.Append(LINKFLAGS = '-mthumb')\n+ env.Append(LINKFLAGS = '-specs=nosys.specs')\n+ env.Append(LINKFLAGS = '-g3')\n+ # object manipulation\n+ env.Replace(OBJCOPY = 'arm-none-eabi-objcopy')\n+ env.Replace(OBJDUMP = 'arm-none-eabi-objdump')\n+ # archiver\n+ env.Replace(AR = 'arm-none-eabi-ar')\n+ env.Append(ARFLAGS = '')\n+ env.Replace(RANLIB = 'arm-none-eabi-ranlib')\n+ env.Append(RANLIBFLAGS = '')\n+ # misc\n+ env.Replace(NM = 'arm-none-eabi-nm')\n+ env.Replace(SIZE = 'arm-none-eabi-size')\n+\n+\nelse:\nraise SystemError('unexpected board={0}'.format(env['board']))\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -117,6 +117,8 @@ command_line_options = {\n'iot-lab_A8-M3',\n'agilefox',\n'samr21_xpro',\n+ # Cortex-M0\n+ 'scum',\n# misc.\n'python',\n],\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/SConscript",
"diff": "+import os\n+\n+Import('env')\n+\n+localEnv = env.Clone()\n+\n+# scons doesn't let us look to parent directories for source, so the\n+# bsp/chips/at86rf231/radio.c is off limits from this file. To keep things\n+# simple, each SConscript file in bsp/chips/* will return a list of objects\n+# which can be appended to the source list. Don't forget to specify a variant_dir,\n+# or else the build will occur directly in the chips directory.\n+\n+source = [\n+ 'board.c',\n+ 'scum_startup.s',\n+ 'cryptoengine.c',\n+ 'debugpins.c',\n+ 'eui64.c',\n+ 'leds.c',\n+ 'radio.c',\n+ 'scm3_hardware_interface.c',\n+ 'sctimer.c',\n+ 'uart.c',\n+ 'interrupts.c'\n+]\n+\n+board = localEnv.Object(source=source)\n+\n+Return('board')\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/interrupts.c",
"diff": "+#include \"uart.h\"\n+#include \"sctimer.h\"\n+#include \"radio.h\"\n+\n+void UART_Handler(void){\n+ uart_rx_isr();\n+}\n+\n+void RF_Handler(void){\n+ radio_isr();\n+}\n+\n+void RFTIMER_Handler(void){\n+ sctimer_isr();\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/interrupts.h",
"diff": "+void UART_Handler(void);\n+void RF_Handler(void);\n+void RFTIMER_Handler(void);\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/scum_linker.ld",
"diff": "+\n+ENTRY(Reset_Handler)\n+\n+MEMORY\n+{\n+ ROM (rx) : ORIGIN = 0x00000000, LENGTH = 64K\n+ RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K\n+}\n+\n+stack_size = 2048;\n+heap_size = 1024;\n+\n+_stack_start = ORIGIN(RAM)+LENGTH(RAM);\n+_stack_end = _stack_start - stack_size;\n+\n+SECTIONS\n+ {\n+ /* The startup code goes first into ROM */\n+ .isr_vector :\n+ {\n+ . = ALIGN(4);\n+ KEEP(*(.isr_vector)) /* Startup code */\n+ . = ALIGN(4);\n+ } >ROM\n+\n+ /* The program code and other data goes into ROM */\n+ .text :\n+ {\n+ . = ALIGN(4);\n+ *(.text) /* .text sections (code) */\n+ *(.text*) /* .text* sections (code) */\n+ *(.rodata) /* .rodata sections (constants, strings, etc.) */\n+ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */\n+ *(.glue_7) /* glue arm to thumb code */\n+ *(.glue_7t) /* glue thumb to arm code */\n+ . = ALIGN(4);\n+ _etext = .; /* define a global symbols at end of code */\n+ } >ROM\n+\n+ .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ROM\n+ .ARM : {\n+ __exidx_start = .;\n+ *(.ARM.exidx*)\n+ __exidx_end = .;\n+ } >ROM\n+\n+ /* used by the startup to initialize data */\n+ _sidata = .;\n+\n+ /* Initialized data sections goes into RAM, load LMA copy after code */\n+ .data : AT ( _sidata )\n+ {\n+ . = ALIGN(4);\n+ _sdata = .; /* create a global symbol at data start */\n+ *(.data) /* .data sections */\n+ *(.data*) /* .data* sections */\n+\n+ . = ALIGN(4);\n+ _edata = .; /* define a global symbol at data end */\n+ } >RAM\n+\n+ /* Uninitialized data section */\n+ . = ALIGN(4);\n+ .bss :\n+ {\n+ /* Used by the startup in order to initialize the .bss secion */\n+ _sbss = .; /* define a global symbol at bss start */\n+ __bss_start__ = _sbss;\n+ *(.bss)\n+ *(.bss*)\n+ *(COMMON)\n+\n+ . = ALIGN(4);\n+ _ebss = .; /* define a global symbol at bss end */\n+ __bss_end__ = _ebss;\n+ } >RAM\n+\n+ . = ALIGN(4);\n+ .heap :\n+ {\n+ _heap_start = .;\n+ . = . + heap_size;\n+ _heap_end = .;\n+ end = _heap_start;\n+ _end = end;\n+ } > RAM\n+\n+ .ARM.attributes 0 : { *(.ARM.attributes) }\n+ }\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/scum/scum_startup.s",
"diff": "+/* File: startup_ARMCM0.S\n+ * Purpose: startup file for Cortex-M0 devices. Should use with\n+ * GCC for ARM Embedded Processors\n+ * Version: V2.01\n+ * Date: 12 June 2014\n+ *\n+ */\n+/* Copyright (c) 2011 - 2014 ARM LIMITED\n+\n+ All rights reserved.\n+ Redistribution and use in source and binary forms, with or without\n+ modification, are permitted provided that the following conditions are met:\n+ - Redistributions of source code must retain the above copyright\n+ notice, this list of conditions and the following disclaimer.\n+ - Redistributions in binary form must reproduce the above copyright\n+ notice, this list of conditions and the following disclaimer in the\n+ documentation and/or other materials provided with the distribution.\n+ - Neither the name of ARM nor the names of its contributors may be used\n+ to endorse or promote products derived from this software without\n+ specific prior written permission.\n+ *\n+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE\n+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ POSSIBILITY OF SUCH DAMAGE.\n+ ---------------------------------------------------------------------------*/\n+\n+\n+ .syntax unified\n+ .arch armv6-m\n+\n+ .section .stack\n+ .align 4\n+#ifdef __STACK_SIZE\n+ .equ Stack_Size, __STACK_SIZE\n+#else\n+ .equ Stack_Size, 0x00000800\n+#endif\n+ .globl __StackTop\n+ .globl __StackLimit\n+__StackLimit:\n+ .space Stack_Size\n+ .size __StackLimit, . - __StackLimit\n+__StackTop:\n+ .size __StackTop, . - __StackTop\n+\n+ .section .heap\n+ .align 4\n+#ifdef __HEAP_SIZE\n+ .equ Heap_Size, __HEAP_SIZE\n+#else\n+ .equ Heap_Size, 0x00000400\n+#endif\n+ .globl __HeapBase\n+ .globl __HeapLimit\n+__HeapBase:\n+ .if Heap_Size\n+ .space Heap_Size\n+ .endif\n+ .size __HeapBase, . - __HeapBase\n+__HeapLimit:\n+ .size __HeapLimit, . - __HeapLimit\n+\n+ .section .vectors\n+ .align 2\n+ .globl __Vectors\n+__Vectors:\n+ .long __StackTop /* Top of Stack */\n+ .long Reset_Handler /* Reset Handler */\n+ .long 0 /* Reserved*/\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved*/\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved */\n+ .long 0 /* Reserved*/\n+ .long 0 /* Reserved */\n+\n+ /* External interrupts */\n+ .long UART_Handler /* 0: UART_ */\n+ .long 0 /* 1: Reserved */\n+ .long 0 /* 2: Reserved */\n+ .long 0 /* 3: Reserved */\n+ .long 0 /* 4: Reserved */\n+ .long 0 /* 5: Reserved */\n+ .long RF_Handler /* 6: RF */\n+ .long RFTIMER_Handler /* 7: RFTimer */\n+ .long 0 /* 8: Reserved */\n+ .long 0 /* 9: Reserved */\n+ .long 0 /* 10: Reserved */\n+ .long 0 /* 11: Reserved */\n+ .long 0 /* 12: Reserved */\n+ .long 0 /* 13: Reserved */\n+ .long 0 /* 14: Reserved */\n+ .long 0 /* 15: Reserved */\n+\n+ .size __Vectors, . - __Vectors\n+\n+ .text\n+ .thumb\n+ .thumb_func\n+ .align 1\n+ .globl Reset_Handler\n+ .type Reset_Handler, %function\n+Reset_Handler:\n+\n+ #Interrupt Set Enable Register\n+ ldr r1, =0xe000e100\n+ #<- REMEMBER TO ENABLE THE INTERRUPTS!!\n+ ldr r0, =0xc1\n+ str r0, [r1]\n+\n+ .global main\n+ b main\n+\n+ .pool\n+ .size Reset_Handler, . - Reset_Handler\n+\n+ .align 1\n+ .thumb_func\n+ .weak Default_Handler\n+ .type Default_Handler, %function\n+Default_Handler:\n+ b .\n+ .size Default_Handler, . - Default_Handler\n+\n+/* Macro to define default handlers. Default handler\n+ * will be weak symbol and just dead loops. They can be\n+ * overwritten by other handlers */\n+ .macro def_irq_handler handler_name\n+ .weak \\handler_name\n+ .set \\handler_name, Default_Handler\n+ .endm\n+\n+ def_irq_handler UART_Handler\n+ def_irq_handler RF_Handler\n+ def_irq_handler RFTIMER_Handler\n+\n+ .end\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. add scum into scons build system.
|
491,595 |
21.08.2018 02:26:17
| -7,200 |
4515cf109a5aafbc81eebd33f732671998d0f1bd
|
update startup and linker file according to ARM_Cortex_M0_DesignStart_Eval examples.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scum_linker.ld",
"new_path": "bsp/boards/scum/scum_linker.ld",
"diff": "+/* Library configurations */\n+GROUP(libgcc.a libc.a libm.a libnosys.a)\nENTRY(Reset_Handler)\n@@ -26,64 +28,113 @@ SECTIONS\n/* The program code and other data goes into ROM */\n.text :\n{\n- . = ALIGN(4);\n- *(.text) /* .text sections (code) */\n- *(.text*) /* .text* sections (code) */\n- *(.rodata) /* .rodata sections (constants, strings, etc.) */\n- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */\n- *(.glue_7) /* glue arm to thumb code */\n- *(.glue_7t) /* glue thumb to arm code */\n- . = ALIGN(4);\n- _etext = .; /* define a global symbols at end of code */\n+ KEEP(*(.isr_vector))\n+ *(.text*)\n+\n+ KEEP(*(.init))\n+ KEEP(*(.fini))\n+\n+ /* .ctors */\n+ *crtbegin.o(.ctors)\n+ *crtbegin?.o(.ctors)\n+ *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)\n+ *(SORT(.ctors.*))\n+ *(.ctors)\n+\n+ /* .dtors */\n+ *crtbegin.o(.dtors)\n+ *crtbegin?.o(.dtors)\n+ *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)\n+ *(SORT(.dtors.*))\n+ *(.dtors)\n+\n+ *(.rodata*)\n+\n+ KEEP(*(.eh_frame*))\n} > ROM\n.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ROM\n- .ARM : {\n+\n__exidx_start = .;\n- *(.ARM.exidx*)\n- __exidx_end = .;\n+ .ARM.exidx :\n+ {\n+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)\n} > ROM\n+ __exidx_end = .;\n+\n+ __etext = .;\n/* used by the startup to initialize data */\n_sidata = .;\n/* Initialized data sections goes into RAM, load LMA copy after code */\n- .data : AT ( _sidata )\n+ .data : AT (__etext)\n{\n+ __data_start__ = .;\n+ *(vtable)\n+ *(.data*)\n+\n. = ALIGN(4);\n- _sdata = .; /* create a global symbol at data start */\n- *(.data) /* .data sections */\n- *(.data*) /* .data* sections */\n+ /* preinit data */\n+ PROVIDE_HIDDEN (__preinit_array_start = .);\n+ KEEP(*(.preinit_array))\n+ PROVIDE_HIDDEN (__preinit_array_end = .);\n. = ALIGN(4);\n- _edata = .; /* define a global symbol at data end */\n+ /* init data */\n+ PROVIDE_HIDDEN (__init_array_start = .);\n+ KEEP(*(SORT(.init_array.*)))\n+ KEEP(*(.init_array))\n+ PROVIDE_HIDDEN (__init_array_end = .);\n+\n+\n+ . = ALIGN(4);\n+ /* finit data */\n+ PROVIDE_HIDDEN (__fini_array_start = .);\n+ KEEP(*(SORT(.fini_array.*)))\n+ KEEP(*(.fini_array))\n+ PROVIDE_HIDDEN (__fini_array_end = .);\n+\n+ KEEP(*(.jcr*))\n+ . = ALIGN(4);\n+ /* All data end */\n+ __data_end__ = .;\n+\n} > RAM\n/* Uninitialized data section */\n- . = ALIGN(4);\n.bss :\n{\n- /* Used by the startup in order to initialize the .bss secion */\n- _sbss = .; /* define a global symbol at bss start */\n- __bss_start__ = _sbss;\n- *(.bss)\n+ . = ALIGN(4);\n+ __bss_start__ = .;\n*(.bss*)\n*(COMMON)\n-\n. = ALIGN(4);\n- _ebss = .; /* define a global symbol at bss end */\n- __bss_end__ = _ebss;\n+ __bss_end__ = .;\n} > RAM\n- . = ALIGN(4);\n- .heap :\n+ .heap (COPY):\n+ {\n+ __end__ = .;\n+ end = __end__;\n+ *(.heap*)\n+ __HeapLimit = .;\n+ } > RAM\n+\n+ /* .stack_dummy section doesn't contains any symbols. It is only\n+ * used for linker to calculate size of stack sections, and assign\n+ * values to stack symbols later */\n+ .stack_dummy (COPY):\n{\n- _heap_start = .;\n- . = . + heap_size;\n- _heap_end = .;\n- end = _heap_start;\n- _end = end;\n+ *(.stack*)\n} > RAM\n- .ARM.attributes 0 : { *(.ARM.attributes) }\n+ /* Set stack top to end of RAM, and stack limit move down by\n+ * size of stack_dummy section */\n+ __StackTop = ORIGIN(RAM) + LENGTH(RAM);\n+ __StackLimit = __StackTop - SIZEOF(.stack_dummy);\n+ PROVIDE(__stack = __StackTop);\n+\n+ /* Check if data + heap + stack exceeds RAM limit */\n+ ASSERT(__StackLimit >= __HeapLimit, \"region RAM overflowed with stack\")\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scum_startup.s",
"new_path": "bsp/boards/scum/scum_startup.s",
"diff": "-/* File: startup_ARMCM0.S\n- * Purpose: startup file for Cortex-M0 devices. Should use with\n- * GCC for ARM Embedded Processors\n- * Version: V2.01\n- * Date: 12 June 2014\n- *\n- */\n-/* Copyright (c) 2011 - 2014 ARM LIMITED\n-\n- All rights reserved.\n- Redistribution and use in source and binary forms, with or without\n- modification, are permitted provided that the following conditions are met:\n- - Redistributions of source code must retain the above copyright\n- notice, this list of conditions and the following disclaimer.\n- - Redistributions in binary form must reproduce the above copyright\n- notice, this list of conditions and the following disclaimer in the\n- documentation and/or other materials provided with the distribution.\n- - Neither the name of ARM nor the names of its contributors may be used\n- to endorse or promote products derived from this software without\n- specific prior written permission.\n- *\n- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n- ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE\n- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n- POSSIBILITY OF SUCH DAMAGE.\n- ---------------------------------------------------------------------------*/\n-\n-\n.syntax unified\n.arch armv6-m\n@@ -69,7 +34,7 @@ __HeapLimit:\n.size __HeapLimit, . - __HeapLimit\n.section .vectors\n- .align 2\n+ .align 4\n.globl __Vectors\n__Vectors:\n.long __StackTop /* Top of Stack */\n@@ -109,10 +74,11 @@ __Vectors:\n.size __Vectors, . - __Vectors\n+/* Reset Handler */\n.text\n.thumb\n.thumb_func\n- .align 1\n+ .align 2\n.globl Reset_Handler\n.type Reset_Handler, %function\nReset_Handler:\n@@ -123,30 +89,29 @@ Reset_Handler:\nldr r0, =0xc1\nstr r0, [r1]\n- .global main\n- b main\n+ ldr r0,=main\n+ blx r0\n- .pool\n.size Reset_Handler, . - Reset_Handler\n- .align 1\n- .thumb_func\n- .weak Default_Handler\n- .type Default_Handler, %function\n-Default_Handler:\n- b .\n- .size Default_Handler, . - Default_Handler\n-\n/* Macro to define default handlers. Default handler\n* will be weak symbol and just dead loops. They can be\n* overwritten by other handlers */\n- .macro def_irq_handler handler_name\n+ .macro def_default_handler handler_name\n+ .align 1\n+ .thumb_func\n.weak \\handler_name\n- .set \\handler_name, Default_Handler\n+ .type \\handler_name, %function\n+\\handler_name :\n+ b .\n+ .size \\handler_name, . - \\handler_name\n.endm\n- def_irq_handler UART_Handler\n- def_irq_handler RF_Handler\n- def_irq_handler RFTIMER_Handler\n+/* System Exception Handlers */\n+\n+/* IRQ Handlers */\n+ def_default_handler UART_Handler\n+ def_default_handler RF_Handler\n+ def_default_handler RFTIMER_Handler\n.end\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update startup and linker file according to ARM_Cortex_M0_DesignStart_Eval examples.
|
491,595 |
21.08.2018 02:26:49
| -7,200 |
ae0ef8acbd127ab4913837d3433a60bc5ddc7491
|
fix prototype warning.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -109,7 +109,7 @@ void analog_scan_chain_write(unsigned int* scan_bits) {\n}\n}\n-void analog_scan_chain_load() {\n+void analog_scan_chain_load(void) {\n// Assert load signal (and cfg<357>)\nANALOG_CFG_REG__22 = 0x0028;\n@@ -121,7 +121,7 @@ void analog_scan_chain_load() {\n/* Prints the value of the 2MHz dac.*/\n-void print_2MHz_DAC() {\n+void print_2MHz_DAC(void) {\nint ind;\n// print the DAC settings\n//printf(\"2MHz DAC: \");\n@@ -204,7 +204,7 @@ void set_2M_RC_frequency(int coarse1, int coarse2, int coarse3, int fine, int su\n/* Initializes the 2MHz DAC with values set in the dac_2M_settings array. */\n-void initialize_2M_DAC() {\n+void initialize_2M_DAC(void) {\nset_2M_RC_frequency(dac_2M_settings[0], dac_2M_settings[1], dac_2M_settings[2], dac_2M_settings[3], dac_2M_settings[4]);\n// printf(\"Initialized 2MHz DAC\\n\");\n// print_2MHz_DAC();\n@@ -240,7 +240,7 @@ int valid_2M_read(int counter) {\n/* Returns 1 if rolling_average_2M is within the calibration window (cal not needed).\nOtherwise, returns 0.*/\n-int is_2M_within_cal_window() {\n+int is_2M_within_cal_window(void) {\nif ((rolling_average_2M < calibration_threshold_min) ||\n(rolling_average_2M > calibration_threshold_max)) {\nreturn 0;\n@@ -254,7 +254,7 @@ which is the number of ticks of the clock in 100ms.\nReturns 0 if no calibration occurs, 1 if the DAC was changed.\n*/\n-int cal_2M_RC() {\n+int cal_2M_RC(void) {\nint ind;\nint counter_dif;\n//printf(\"Calibrating 2M oscillator.\\n\");\n@@ -529,7 +529,7 @@ If any value in the array is 0, it is not counted.\nIf the rolling average is outside the calibration threshold, we calibrate the dac.\n*/\n-void compute_2M_rolling_average() {\n+void compute_2M_rolling_average(void) {\nint index;\ndouble average;\nint sum = 0;\n@@ -554,7 +554,7 @@ void compute_2M_rolling_average() {\n}\n-void initialize_ASC(){\n+void initialize_ASC(void){\n// The meaning of each bit is explained in scm3_ASC_v9.m script\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. fix prototype warning.
|
491,595 |
21.08.2018 02:28:01
| -7,200 |
5e3058c352e1aaac28f84b14b8a11af4965b2dc8
|
reduce code size according to
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -397,28 +397,25 @@ elif env['toolchain']=='armgcc':\n# compiler (C)\nenv.Replace(CC = 'arm-none-eabi-gcc')\n- env.Append(CCFLAGS = '-O0')\n+ env.Append(CCFLAGS = '-O3')\nenv.Append(CCFLAGS = '-Wall')\n- env.Append(CCFLAGS = '-c')\n- env.Append(CCFLAGS = '-fmessage-length=0')\nenv.Append(CCFLAGS = '-mcpu=cortex-m0')\nenv.Append(CCFLAGS = '-mthumb')\n- env.Append(CCFLAGS = '-mthumb-interwork')\n- env.Append(CCFLAGS = '-g3')\n- env.Append(CCFLAGS = '-Wstrict-prototypes')\n+ env.Append(CCFLAGS = '-g')\nenv.Append(CCFLAGS = '-Ibsp/boards/scum')\nenv.Append(CCFLAGS = '-std=c99')\n- env.Append(CCFLAGS = '-nostartfiles')\n+ env.Append(CCFLAGS = '-ffunction-sections')\n+ env.Append(CCFLAGS = '-fdata-sections')\n# assembler\nenv.Replace(AS = 'arm-none-eabi-as')\n- env.Append(ASFLAGS = '-ggdb -g3 -mcpu=cortex-m0 -mlittle-endian -mapcs-32')\n+ env.Append(ASFLAGS = '-ggdb -g3 -mcpu=cortex-m0 -mlittle-endian -mthumb')\n# linker\nenv.Append(LINKFLAGS = '-Tbsp/boards/scum/scum_linker.ld')\n- #env.Append(LINKFLAGS = '-nostartfiles')\n- env.Append(LINKFLAGS = '-mcpu=cortex-m0')\n- env.Append(LINKFLAGS = '-mthumb')\n+ env.Append(LINKFLAGS = '-nostartfiles')\n+ env.Append(LINKFLAGS = '-Wl,--gc-sections')\nenv.Append(LINKFLAGS = '-specs=nosys.specs')\n- env.Append(LINKFLAGS = '-g3')\n+ env.Append(LINKFLAGS = '-D__STACK_SIZE=0x800')\n+ env.Append(LINKFLAGS = '-D__HEAP_SIZE=0x400')\n# object manipulation\nenv.Replace(OBJCOPY = 'arm-none-eabi-objcopy')\nenv.Replace(OBJDUMP = 'arm-none-eabi-objdump')\n@@ -431,7 +428,6 @@ elif env['toolchain']=='armgcc':\nenv.Replace(NM = 'arm-none-eabi-nm')\nenv.Replace(SIZE = 'arm-none-eabi-size')\n-\nelse:\nraise SystemError('unexpected board={0}'.format(env['board']))\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. reduce code size according to http://blog.atollic.com/the-ultimate-guide-to-reducing-code-size-with-gnu-gcc-for-arm-cortex-m.
|
491,595 |
21.08.2018 16:44:06
| -7,200 |
b9f6e6577ef45d37a49a119d9bccf77c2f3eeb13
|
add bootload support for scums.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -403,7 +403,6 @@ elif env['toolchain']=='armgcc':\nenv.Append(CCFLAGS = '-mthumb')\nenv.Append(CCFLAGS = '-g')\nenv.Append(CCFLAGS = '-Ibsp/boards/scum')\n- env.Append(CCFLAGS = '-std=c99')\nenv.Append(CCFLAGS = '-ffunction-sections')\nenv.Append(CCFLAGS = '-fdata-sections')\n# assembler\n@@ -763,6 +762,52 @@ def IotLabM3_bootload(target, source, env):\nfor t in bootloadThreads:\ncountingSem.acquire()\n+class scum_bootloadThread(threading.Thread):\n+ def __init__(self,comPort,binaryFile,countingSem):\n+\n+ # store params\n+ self.comPort = comPort\n+ self.binaryFile = binaryFile\n+ self.countingSem = countingSem\n+\n+ # initialize parent class\n+ threading.Thread.__init__(self)\n+ self.name = 'scum_bootloadThread{0}'.format(self.comPort)\n+\n+ def run(self):\n+ print 'starting bootloading on {0}'.format(self.comPort)\n+ subprocess.call(\n+ 'python '+ os.path.join('bootloader','scum','scum_bootloader.py' + ' -p {0} {1}'.format(self.comPort, self.binaryFile)),\n+ shell=True\n+ )\n+ print 'done bootloading on {0}'.format(self.comPort)\n+\n+ # indicate done\n+ self.countingSem.release()\n+\n+def scum_bootload(target, source, env):\n+ bootloadThreads = []\n+ countingSem = threading.Semaphore(0)\n+ # create threads\n+ for comPort in env['bootload'].split(','):\n+ if os.name=='nt':\n+ suffix = '.bin'\n+ else:\n+ suffix = ''\n+ bootloadThreads += [\n+ scum_bootloadThread(\n+ comPort = comPort,\n+ binaryFile = source[0].path.split('.')[0]+suffix,\n+ countingSem = countingSem,\n+ )\n+ ]\n+ # start threads\n+ for t in bootloadThreads:\n+ t.start()\n+ # wait for threads to finish\n+ for t in bootloadThreads:\n+ countingSem.acquire()\n+\n# bootload\ndef BootloadFunc():\nif env['board']=='telosb':\n@@ -789,6 +834,12 @@ def BootloadFunc():\nsuffix = '.phonyupload',\nsrc_suffix = '.bin'\n)\n+ elif env['board']=='scum':\n+ return Builder(\n+ action = scum_bootload,\n+ suffix = '.phonyupload',\n+ src_suffix = '.bin'\n+ )\nelse:\nraise SystemError('bootloading on board={0} unsupported.'.format(env['board']))\nif env['bootload']:\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bootloader/scum/scum_bootloader.py",
"diff": "+import getopt\n+import sys\n+import serial\n+\n+if __name__ == \"__main__\":\n+\n+ conf = {\n+ 'port': 'auto',\n+ 'baud': 1000000,\n+ }\n+\n+ try:\n+ opts, args = getopt.getopt(sys.argv[1:], \"hp:b:\", ['help'])\n+ except getopt.GetoptError as err:\n+ print(str(err))\n+ usage()\n+ sys.exit(2)\n+\n+ for o, a in opts:\n+ if o == '-p':\n+ conf['port'] = a\n+ elif o == '-b':\n+ conf['baud'] = eval(a)\n+\n+ try:\n+ args[0]\n+ except:\n+ raise Exception('No file path given.')\n+\n+ # open serial port\n+ ser = serial.Serial(\n+ port=conf['port'],\n+ baudrate=conf['baud'],\n+ parity=serial.PARITY_NONE,\n+ stopbits=serial.STOPBITS_ONE,\n+ bytesize=serial.EIGHTBITS\n+ )\n+\n+ with open(args[0], \"rb\") as f:\n+ data = f.read()\n+ assert len(data)<65535, 'the image has to be smaller than 64KB!'\n+\n+ # write secret characters\n+ ser.write(\"transfersram\\n\")\n+ print ser.readline()\n+\n+ # Send the binary data over uart\n+ ser.write(data[0:65535])\n+ # Send all zeros to pad out to the full size of sram (64kB)\n+ ser.write(\"\\0\" * (65536-len(data)))\n+ print ser.readline()\n+\n+ ser.write(\"boot3wb\\n\")\n+ print ser.readline()\n+\n+ print \"transfer complete\"\n+\n+ ser.close()\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scum_startup.s",
"new_path": "bsp/boards/scum/scum_startup.s",
"diff": "#ifdef __STACK_SIZE\n.equ Stack_Size, __STACK_SIZE\n#else\n- .equ Stack_Size, 0x00000800\n+ .equ Stack_Size, 0x800\n#endif\n.globl __StackTop\n.globl __StackLimit\n@@ -21,7 +21,7 @@ __StackTop:\n#ifdef __HEAP_SIZE\n.equ Heap_Size, __HEAP_SIZE\n#else\n- .equ Heap_Size, 0x00000400\n+ .equ Heap_Size, 0x400\n#endif\n.globl __HeapBase\n.globl __HeapLimit\n@@ -34,7 +34,6 @@ __HeapLimit:\n.size __HeapLimit, . - __HeapLimit\n.section .vectors\n- .align 4\n.globl __Vectors\n__Vectors:\n.long __StackTop /* Top of Stack */\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. add bootload support for scums.
|
491,595 |
21.08.2018 17:17:30
| -7,200 |
43e2ed73cba0083fd7e58822811b298bfdafdd90
|
update DISABLE_INTERRUPTS and ENABLE_INTERRUPTS functions.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -17,8 +17,10 @@ to return the board's description.\n#define INTERRUPT_DECLARATION()\n-#define DISABLE_INTERRUPTS() __disable_irq();\n-#define ENABLE_INTERRUPTS() __enable_irq();\n+#define DISABLE_INTERRUPTS() __asm__( \"MOVS R0, #1;\" \\\n+ \"MSR PRIMASK, R0;\");\n+#define ENABLE_INTERRUPTS() __asm__( \"MOVS R0, #0;\" \\\n+ \"MSR PRIMASK, R0;\");\n//===== timer\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update DISABLE_INTERRUPTS and ENABLE_INTERRUPTS functions.
|
491,595 |
21.08.2018 22:16:06
| -7,200 |
0927614f04b802080dc29053f9d539b660b52d90
|
fix the bugs in linker file and start up file.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scum_linker.ld",
"new_path": "bsp/boards/scum/scum_linker.ld",
"diff": "@@ -9,22 +9,8 @@ MEMORY\nRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K\n}\n-stack_size = 2048;\n-heap_size = 1024;\n-\n-_stack_start = ORIGIN(RAM)+LENGTH(RAM);\n-_stack_end = _stack_start - stack_size;\n-\nSECTIONS\n{\n- /* The startup code goes first into ROM */\n- .isr_vector :\n- {\n- . = ALIGN(4);\n- KEEP(*(.isr_vector)) /* Startup code */\n- . = ALIGN(4);\n- } >ROM\n-\n/* The program code and other data goes into ROM */\n.text :\n{\n@@ -53,7 +39,10 @@ SECTIONS\nKEEP(*(.eh_frame*))\n} > ROM\n- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >ROM\n+ .ARM.extab :\n+ {\n+ *(.ARM.extab* .gnu.linkonce.armextab.*)\n+ } > ROM\n__exidx_start = .;\n.ARM.exidx :\n@@ -64,10 +53,6 @@ SECTIONS\n__etext = .;\n- /* used by the startup to initialize data */\n- _sidata = .;\n-\n- /* Initialized data sections goes into RAM, load LMA copy after code */\n.data : AT (__etext)\n{\n__data_start__ = .;\n@@ -102,7 +87,6 @@ SECTIONS\n} > RAM\n- /* Uninitialized data section */\n.bss :\n{\n. = ALIGN(4);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scum_startup.s",
"new_path": "bsp/boards/scum/scum_startup.s",
"diff": "@@ -33,9 +33,10 @@ __HeapBase:\n__HeapLimit:\n.size __HeapLimit, . - __HeapLimit\n- .section .vectors\n- .globl __Vectors\n-__Vectors:\n+ .section .isr_vector\n+ .align 2\n+ .globl __isr_vector\n+__isr_vector:\n.long __StackTop /* Top of Stack */\n.long Reset_Handler /* Reset Handler */\n.long 0 /* Reserved */\n@@ -71,7 +72,7 @@ __Vectors:\n.long 0 /* 14: Reserved */\n.long 0 /* 15: Reserved */\n- .size __Vectors, . - __Vectors\n+ .size __isr_vector, . - __isr_vector\n/* Reset Handler */\n.text\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. fix the bugs in linker file and start up file.
|
491,595 |
22.08.2018 15:44:16
| -7,200 |
6f01aa1788ca55b829f0275b57d07ecf9da64bd6
|
create a map for the generated image.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -412,6 +412,7 @@ elif env['toolchain']=='armgcc':\nenv.Append(LINKFLAGS = '-Tbsp/boards/scum/scum_linker.ld')\nenv.Append(LINKFLAGS = '-nostartfiles')\nenv.Append(LINKFLAGS = '-Wl,--gc-sections')\n+ env.Append(LINKFLAGS = '-Wl,-Map,${TARGET.base}.map')\nenv.Append(LINKFLAGS = '-specs=nosys.specs')\nenv.Append(LINKFLAGS = '-D__STACK_SIZE=0x800')\nenv.Append(LINKFLAGS = '-D__HEAP_SIZE=0x400')\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. create a map for the generated image.
|
491,595 |
25.08.2018 20:06:54
| -7,200 |
52d74fb3007768ffbd30b6b1948a23cea36913b1
|
update the rftimer converter value.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -34,25 +34,20 @@ to return the board's description.\n// ==== SCuM RF timer specific\n-/**\n-* since SCuM uses 500kHz, but the stack protocol is designed for 32kHz.\n-* the following two marcos are used to convert the counter value bewteen\n-* two different frequency clocks. 500000/32768 is approximately 61/4.\n-**/\n-\n-// with the setup of FPGA board +teensy, the sys clock is 2.5MHz, so the\n-// following time converting is between 32KHz and 2.5MHz\n+// with the setup of FPGA board +teensy, the rftimer clock is\n+// 20MHz divided by 255 (around 78431Hz), the following code is converting\n+// between 32768Hz and 78431Hz, the ratio between them is around\n+// the radio bewteen 23 and 55\n+// NOTICE:\n+// 1) 255 is the maxium value can be divided.\n+// 2) on FPGA, 20MHz clock can't be slow down.\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(value) value*305/4\n+#define TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(value) value*55/23\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(value) value*4/305\n-\n-/**\n-* End\n-**/\n+#define TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(value) value*23/55\n//===== radio\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update the rftimer converter value.
|
491,595 |
25.08.2018 20:10:25
| -7,200 |
02bc9fdb8f43ba5ed245897b5e94475db99889ba
|
change converter name.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -44,10 +44,10 @@ to return the board's description.\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(value) value*55/23\n+#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*55/23\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(value) value*23/55\n+#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*23/55\n//===== radio\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "@@ -264,7 +264,7 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & TX_SFD_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE0);\n+ capturedTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__CAPTURE0);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = TX_SFD_DONE_INT;\n// a SFD is just sent, update radio state\n@@ -273,7 +273,7 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & RX_SFD_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE1);\n+ capturedTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__CAPTURE1);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_SFD_DONE_INT;\n// a SFD is just received, update radio state\n@@ -292,14 +292,14 @@ kick_scheduler_t radio_isr(void) {\nif (irq_status & TX_SEND_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE2);\n+ capturedTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__CAPTURE2);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = TX_SEND_DONE_INT;\n}\nif (irq_status & RX_DONE_INT) {\n#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n// get the capture Time from capture register\n- capturedTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__CAPTURE3);\n+ capturedTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__CAPTURE3);\n#endif\nRFCONTROLLER_REG__INT_CLEAR = RX_DONE_INT;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/sctimer.c",
"new_path": "bsp/boards/scum/sctimer.c",
"diff": "@@ -58,7 +58,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\nPORT_TIMER_WIDTH currentTime;\n- currentTime = TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__COUNTER);\n+ currentTime = TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__COUNTER);\nsctimer_enable();\nif (currentTime - val < TIMERLOOP_THRESHOLD){\n@@ -75,7 +75,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\n} else {\n// mark clear the flag here\n// schedule the timer at val\n- RFTIMER_REG__COMPARE0 = (PORT_TIMER_WIDTH)(TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(val) & RFTIMER_MAX_COUNT);\n+ RFTIMER_REG__COMPARE0 = (PORT_TIMER_WIDTH)(TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(val) & RFTIMER_MAX_COUNT);\nRFTIMER_REG__COMPARE0_CONTROL = RFTIMER_COMPARE_ENABLE | \\\nRFTIMER_COMPARE_INTERRUPT_ENABLE;\n}\n@@ -88,7 +88,7 @@ void sctimer_setCompare(PORT_TIMER_WIDTH val){\n\\returns The current value of the timer's counter.\n*/\nPORT_TIMER_WIDTH sctimer_readCounter(void){\n- return TIMER_COUNTER_CONVERT_SYS_CLK_TO_32K(RFTIMER_REG__COUNTER);\n+ return TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(RFTIMER_REG__COUNTER);\n}\nvoid sctimer_enable(void){\n@@ -111,7 +111,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nswitch(type){\ncase ACTION_LOAD_PACKET:\n// offset when to fire\n- RFTIMER_REG__COMPARE3 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n+ RFTIMER_REG__COMPARE3 = TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(offset);\n// enable compare and tx load interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE3_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -120,7 +120,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_SEND_PACKET:\n// offset when to fire\n- RFTIMER_REG__COMPARE4 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n+ RFTIMER_REG__COMPARE4 = TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(offset);\n// enable compare and tx send interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE4_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -129,7 +129,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_RADIORX_ENABLE:\n// offset when to fire\n- RFTIMER_REG__COMPARE5 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n+ RFTIMER_REG__COMPARE5 = TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(offset);\n// enable compare and rx start interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE5_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n@@ -138,7 +138,7 @@ void sctimer_scheduleActionIn(uint8_t type,PORT_RADIOTIMER_WIDTH offset){\nbreak;\ncase ACTION_SET_TIMEOUT:\n// offset when to fire\n- RFTIMER_REG__COMPARE2 = TIMER_COUNTER_CONVERT_32K_TO_SYS_CLK(offset);\n+ RFTIMER_REG__COMPARE2 = TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(offset);\n// enable compare interrupt (this also cancels any pending interrupts)\nRFTIMER_REG__COMPARE2_CONTROL = RFTIMER_COMPARE_ENABLE |\\\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. change converter name.
|
491,595 |
27.08.2018 18:26:18
| -7,200 |
b2f16c8420fec18d71cda210907b690ca8230d33
|
update scum bsp driver according to the latest design.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/debugpins.c",
"new_path": "bsp/boards/scum/debugpins.c",
"diff": "@@ -18,78 +18,82 @@ To be implemented after issue: SCUM-25\n//=========================== public ==========================================\nvoid debugpins_init(void) {\n- // GPIO pin 8 to 13 are used as debugpins,\n- GPIO_REG__OUTPUT &= ~0x3F00; // all PINS low at initial\n+ // GPIO pin 13 to 16 are used as debugpins,\n+ GPIO_REG__OUTPUT &= ~0xF000; // all PINS low at initial\n}\nvoid debugpins_frame_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x0100;\n+ GPIO_REG__OUTPUT ^= 0x1000;\n}\nvoid debugpins_frame_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x0100;\n+ GPIO_REG__OUTPUT &= ~0x1000;\n}\nvoid debugpins_frame_set(void) {\n- GPIO_REG__OUTPUT |= 0x0100;\n+ GPIO_REG__OUTPUT |= 0x1000;\n}\nvoid debugpins_slot_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x0200;\n+ GPIO_REG__OUTPUT ^= 0x2000;\n}\nvoid debugpins_slot_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x0200;\n+ GPIO_REG__OUTPUT &= ~0x2000;\n}\nvoid debugpins_slot_set(void) {\n- GPIO_REG__OUTPUT |= 0x0200;\n+ GPIO_REG__OUTPUT |= 0x2000;\n}\nvoid debugpins_fsm_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x0400;\n+ GPIO_REG__OUTPUT ^= 0x4000;\n}\nvoid debugpins_fsm_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x0400;\n+ GPIO_REG__OUTPUT &= ~0x4000;\n}\nvoid debugpins_fsm_set(void) {\n- GPIO_REG__OUTPUT |= 0x0400;\n+ GPIO_REG__OUTPUT |= 0x4000;\n}\n+// no enough pin for debugpins task\n+\nvoid debugpins_task_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x0800;\n+ // GPIO_REG__OUTPUT ^= 0x8000;\n}\nvoid debugpins_task_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x0800;\n+ // GPIO_REG__OUTPUT &= ~0x8000;\n}\nvoid debugpins_task_set(void) {\n- GPIO_REG__OUTPUT |= 0x0800;\n+ // GPIO_REG__OUTPUT |= 0x8000;\n}\nvoid debugpins_isr_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x1000;\n+ GPIO_REG__OUTPUT ^= 0x8000;\n}\nvoid debugpins_isr_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x1000;\n+ GPIO_REG__OUTPUT &= ~0x8000;\n}\nvoid debugpins_isr_set(void) {\n- GPIO_REG__OUTPUT |= 0x1000;\n+ GPIO_REG__OUTPUT |= 0x8000;\n}\n+// no enough pin for debugpins radio\n+\nvoid debugpins_radio_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x2000;\n+ // GPIO_REG__OUTPUT ^= 0x2000;\n}\nvoid debugpins_radio_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x2000;\n+ // GPIO_REG__OUTPUT &= ~0x2000;\n}\nvoid debugpins_radio_set(void) {\n- GPIO_REG__OUTPUT |= 0x2000;\n+ // GPIO_REG__OUTPUT |= 0x2000;\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/leds.c",
"new_path": "bsp/boards/scum/leds.c",
"diff": "//=========================== public ==========================================\nvoid leds_init(void) {\n- GPIO_REG__OUTPUT &= ~0xF0; // GPIO_REG__OUTPUT = 0bxxxx0000, all LEDs off\n+ GPIO_REG__OUTPUT &= ~0xF00; // GPIO_REG__OUTPUT = 0bxxxx00000000, all LEDs off\n}\n// 0 <H17>\nvoid leds_error_on(void) {\n- GPIO_REG__OUTPUT |= 0x10;\n+ GPIO_REG__OUTPUT |= 0x100;\n}\nvoid leds_error_off(void) {\n- GPIO_REG__OUTPUT &= ~0x10;\n+ GPIO_REG__OUTPUT &= ~0x100;\n}\nvoid leds_error_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x10;\n+ GPIO_REG__OUTPUT ^= 0x100;\n}\nuint8_t leds_error_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x10);\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x100);\n}\n// 1 <K15>\nvoid leds_radio_on(void) {\n- GPIO_REG__OUTPUT |= 0x20;\n+ GPIO_REG__OUTPUT |= 0x200;\n}\nvoid leds_radio_off(void) {\n- GPIO_REG__OUTPUT &= ~0x20;\n+ GPIO_REG__OUTPUT &= ~0x200;\n}\nvoid leds_radio_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x20;\n+ GPIO_REG__OUTPUT ^= 0x200;\n}\nuint8_t leds_radio_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x20)>>1;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x200)>>1;\n}\n// 2 <J13>\nvoid leds_sync_on(void) {\n- GPIO_REG__OUTPUT |= 0x40;\n+ GPIO_REG__OUTPUT |= 0x400;\n}\nvoid leds_sync_off(void) {\n- GPIO_REG__OUTPUT &= ~0x40;\n+ GPIO_REG__OUTPUT &= ~0x400;\n}\nvoid leds_sync_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x40;\n+ GPIO_REG__OUTPUT ^= 0x400;\n}\nuint8_t leds_sync_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x40)>>2;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x400)>>2;\n}\n// 3 <N14>\nvoid leds_debug_on(void) {\n- GPIO_REG__OUTPUT |= 0x80;\n+ GPIO_REG__OUTPUT |= 0x800;\n}\nvoid leds_debug_off(void) {\n- GPIO_REG__OUTPUT &= ~0x80;\n+ GPIO_REG__OUTPUT &= ~0x800;\n}\nvoid leds_debug_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x80;\n+ GPIO_REG__OUTPUT ^= 0x800;\n}\nuint8_t leds_debug_isOn(void) {\n- return (uint8_t)(GPIO_REG__OUTPUT & 0x80)>>3;\n+ return (uint8_t)(GPIO_REG__OUTPUT & 0x800)>>3;\n}\nvoid leds_all_on(void) {\n- GPIO_REG__OUTPUT |= 0xF0;\n+ GPIO_REG__OUTPUT |= 0xF00;\n}\nvoid leds_all_off(void) {\n- GPIO_REG__OUTPUT &= ~0xF0;\n+ GPIO_REG__OUTPUT &= ~0xF00;\n}\nvoid leds_all_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0xF0;\n+ GPIO_REG__OUTPUT ^= 0xF00;\n}\nvoid leds_error_blink(void) {\nuint8_t i;\nvolatile uint16_t delay;\n// turn all LEDs off\n- GPIO_REG__OUTPUT &= ~0xF0;\n+ GPIO_REG__OUTPUT &= ~0xF00;\n// blink error LED for ~10s\nfor (i=0;i<80;i++) {\n- GPIO_REG__OUTPUT ^= 0x10;\n+ GPIO_REG__OUTPUT ^= 0x100;\nfor (delay=0xffff;delay>0;delay--);\n}\n}\nvoid leds_circular_shift(void) {\n- uint8_t temp_leds;\n- if ((GPIO_REG__OUTPUT & 0xF0)==0) { // if no LEDs on, switch on first one\n- GPIO_REG__OUTPUT |= 0x10;\n+ uint16_t temp_leds;\n+ if ((GPIO_REG__OUTPUT & 0xF00)==0) { // if no LEDs on, switch on first one\n+ GPIO_REG__OUTPUT |= 0x100;\nreturn;\n}\n- temp_leds = GPIO_REG__OUTPUT & 0xF0; // retrieve current status of LEDs\n+ temp_leds = GPIO_REG__OUTPUT & 0xF00; // retrieve current status of LEDs\ntemp_leds <<= 1; // shift by one position\n- if ((temp_leds & 0x10)!=0) {\n+ if ((temp_leds & 0x100)!=0) {\ntemp_leds++; // handle overflow\n}\nGPIO_REG__OUTPUT |= temp_leds; // switch on the leds marked '1' in temp_leds\n- GPIO_REG__OUTPUT &= ~(~temp_leds & 0xF0); // switch off the leds marked '0' in temp_leds\n+ GPIO_REG__OUTPUT &= ~(~temp_leds & 0xF00); // switch off the leds marked '0' in temp_leds\n}\nvoid leds_increment(void) {\n- uint8_t led_counter;\n- led_counter = ((GPIO_REG__OUTPUT & 0xf0)+0x10);\n- GPIO_REG__OUTPUT &= ~0xf0; //all LEDs off\n- GPIO_REG__OUTPUT |= led_counter & 0xf0; //LEDs on again\n+ uint16_t led_counter;\n+ led_counter = ((GPIO_REG__OUTPUT & 0xF00)+0x100);\n+ GPIO_REG__OUTPUT &= ~0xF00; //all LEDs off\n+ GPIO_REG__OUTPUT |= led_counter & 0xF00; //LEDs on again\n}\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/memory_map.h",
"new_path": "bsp/boards/scum/memory_map.h",
"diff": "// ========================== Analog Configure Registers ======================\n#define ANALOG_CFG_REG__0 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x000000)\n+#define ANALOG_CFG_REG__1 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x040000)\n+#define ANALOG_CFG_REG__2 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x080000)\n+#define ANALOG_CFG_REG__3 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x0C0000)\n+#define ANALOG_CFG_REG__4 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x100000)\n+#define ANALOG_CFG_REG__9 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x240000)\n+#define ANALOG_CFG_REG__10 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x280000)\n+#define ANALOG_CFG_REG__11 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x2C0000)\n#define ANALOG_CFG_REG__22 *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x580000)\n#define ACFG_LO__ADDR *(unsigned int*)(APB_ANALOG_CFG_BASE + 0x001C0000)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/scm3_hardware_interface.c",
"new_path": "bsp/boards/scum/scm3_hardware_interface.c",
"diff": "@@ -556,46 +556,47 @@ void compute_2M_rolling_average(void) {\nvoid initialize_ASC(void){\n+ ANALOG_CFG_REG__11 = 0x0080;\n+\n// The meaning of each bit is explained in scm3_ASC_v9.m script\n- ASC[0] = 0xC0000000; //0-31\n- ASC[1] = 0x00000000; //32-63\n+ ASC[0] = 0xFF800000; //0-31\n+ ASC[1] = 0x00400000; //32-63\nASC[2] = 0x00000000; //64-95\n- ASC[3] = 0x00000000; //96-127\n- ASC[4] = 0x00000000; //128-159\n+ ASC[3] = 0x000E0006; //96-127\n+ ASC[4] = 0x48000000; //128-159\nASC[5] = 0x00000000; //160-191\n- ASC[6] = 0x00000000; //192-223\n- ASC[7] = 0x00000033; //224-255\n- ASC[8] = 0x2207FFFF; //256-287\n- ASC[9] = 0xE0C66388; //288-319\n- ASC[10] = 0x88040020; //320-351\n- ASC[11] = 0x000C0000; //352-383\n- ASC[12] = 0x00180000; //384-415\n- ASC[13] = 0x03D04000; //416-447\n- ASC[14] = 0x200100FF; //448-479\n- ASC[15] = 0xFBF02857; //480-511\n- ASC[16] = 0x97FFFF00; //512-543\n- ASC[17] = 0x22300080; //544-575\n- ASC[18] = 0x010205F9; //576-607\n- ASC[19] = 0x0506E7E8; //608-639\n- ASC[20] = 0x10200040; //640-671\n- ASC[21] = 0x03111810; //672-703\n- ASC[22] = 0x2FFFFC00; //704-735\n- ASC[23] = 0x20000000; //736-767\n+ ASC[6] = 0x00001000; //192-223\n+ ASC[7] = 0x0003012B; //224-255\n+ ASC[8] = 0x3306FC00; //256-287\n+ ASC[9] = 0x00422188; //288-319\n+ ASC[10] = 0x88040031; //320-351\n+ ASC[11] = 0x113F4081; //352-383\n+ ASC[12] = 0x027E8102; //384-415\n+ ASC[13] = 0x02605844; //416-447\n+ ASC[14] = 0x60010000; //448-479\n+ ASC[15] = 0x07EF0803; //480-511\n+ ASC[16] = 0x00000000; //512-543\n+ ASC[17] = 0x00000000; //544-575\n+ ASC[18] = 0x00000000; //576-607\n+ ASC[19] = 0x00000000; //608-639\n+ ASC[20] = 0x00000000; //640-671\n+ ASC[21] = 0x00000000; //672-703\n+ ASC[22] = 0x00000000; //704-735\n+ ASC[23] = 0x00000000; //736-767\nASC[24] = 0x00007CFC; //768-799\n- ASC[25] = 0x20000018; //800-831\n- ASC[26] = 0x02800000; //832-863\n+ ASC[25] = 0x20000000; //800-831\n+ ASC[26] = 0x00000000; //832-863\nASC[27] = 0x00000000; //864-895\n- ASC[28] = 0x00000000; //896-927\n- ASC[29] = 0x00000000; //928-959\n- ASC[30] = 0x00000000; //960-991\n- ASC[31] = 0x000007FC; //992-1023\n- ASC[32] = 0x80000012; //1024-1055\n- ASC[33] = 0xC004B000; //1056-1087\n- ASC[34] = 0x7C000015; //1088-1119 enable GPIO\n- ASC[35] = 0x4AAAAAA0; //GPIO 0- 3 in\n-\n- ASC[36] = 0x00000000; //1152-1183\n+ ASC[28] = 0x00000810; //896-927\n+ ASC[29] = 0x007824DB; //928-959\n+ ASC[30] = 0x48000807; //960-991\n+ ASC[31] = 0xF0300805; //992-1023\n+ ASC[32] = 0x7028E07E; //1024-1055\n+ ASC[33] = 0x19A4B0C4; //1056-1087\n+ ASC[34] = 0x7FFF6840; //1088-1119\n+ ASC[35] = 0x00078000; //1120-1151\n+ ASC[36] = 0x08000000; //1152-1183\nASC[37] = 0x00000000;\nanalog_scan_chain_write(&ASC[0]);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update scum bsp driver according to the latest design.
|
491,595 |
27.08.2018 20:04:29
| -7,200 |
747402de7ca47cf9abed87ca2c79bef47e49dd79
|
add comments to the converter.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -42,6 +42,11 @@ to return the board's description.\n// 1) 255 is the maxium value can be divided.\n// 2) on FPGA, 20MHz clock can't be slow down.\n+// NOTE:\n+// This convert has a problem that when multiple the value, it may exceeds\n+// 0xffffffff, resulting a wrong converting. Resolve this problem when the\n+// frequency of rftimer is determined finally.\n+\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*55/23\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. add comments to the converter.
|
491,595 |
27.08.2018 20:08:31
| -7,200 |
7a3911b97339456b4a165d6c8c6522acee3e7e88
|
update compiler version for multipltimer_radio project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.uvprojx",
"new_path": "projects/scum/01bsp_multipletimer_radio/01bsp_multipletimer_radio.uvprojx",
"diff": "<TargetName>Target 1</TargetName>\n<ToolsetNumber>0x4</ToolsetNumber>\n<ToolsetName>ARM-ADS</ToolsetName>\n- <pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>\n+ <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>\n<uAC6>0</uAC6>\n<TargetOption>\n<TargetCommonOption>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update compiler version for multipltimer_radio project.
|
491,595 |
27.08.2018 23:07:25
| -7,200 |
5d4a9b261e7f4a29dfa5573c95791697e5eedd3c
|
enable capture when listenning for EB to join.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -545,6 +545,11 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// configure the radio to listen to the default synchronizing channel\nradio_setFrequency(ieee154e_vars.freq);\n+#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+ sctimer_setCapture(ACTION_RX_SFD_DONE);\n+ sctimer_setCapture(ACTION_RX_DONE);\n+#endif\n+\n// switch on the radio in Rx mode.\nradio_rxEnable();\nradio_rxNow();\n@@ -567,6 +572,11 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// configure the radio to listen to the default synchronizing channel\nradio_setFrequency(ieee154e_vars.freq);\n+#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+ sctimer_setCapture(ACTION_RX_SFD_DONE);\n+ sctimer_setCapture(ACTION_RX_DONE);\n+#endif\n+\n// switch on the radio in Rx mode.\nradio_rxEnable();\nradio_rxNow();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. enable capture when listenning for EB to join.
|
491,606 |
28.08.2018 14:05:52
| -7,200 |
da3b432697abdf9bc8c66f4c48809dee54302346
|
we found an issue which disabled the interrupts in the schedule and didn't reenabled them in all cases, that led to the stuck timers in the nordic case
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -544,6 +544,7 @@ open_addr_t* schedule_getNonParentNeighborWithDedicatedCells(open_addr_t* neighb\nschedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\npacketfunctions_sameAddress(&schedule_vars.scheduleBuf[i].neighbor, neighbor) == FALSE\n){\n+ ENABLE_INTERRUPTS();\nreturn &schedule_vars.scheduleBuf[i].neighbor;\n}\n}\n@@ -602,6 +603,7 @@ bool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist\nif (highestPDR==0){\n// no cell to relocate\n+ ENABLE_INTERRUPTS();\nreturn FALSE;\n}\n@@ -615,6 +617,7 @@ bool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist\ncelllist->isUsed = TRUE;\ncelllist->slotoffset = schedule_vars.scheduleBuf[i].slotOffset;\ncelllist->channeloffset = schedule_vars.scheduleBuf[i].channelOffset;\n+ ENABLE_INTERRUPTS();\nreturn TRUE;\n}\n}\n@@ -637,6 +640,7 @@ bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor){\nschedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\npacketfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n){\n+ ENABLE_INTERRUPTS();\nreturn TRUE;\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-737
we found an issue which disabled the interrupts in the schedule and didn't reenabled them in all cases, that led to the stuck timers in the nordic case
|
491,595 |
29.08.2018 14:55:33
| -7,200 |
19bddd18d67da2e308cef48e3b4dc7f3b8501481
|
default rssi value is -50.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/radio.c",
"new_path": "bsp/boards/scum/radio.c",
"diff": "// ==== default crc check result and rssi value\n#define DEFAULT_CRC_CHECK 0x01 // this is an arbitrary value for now\n-#define DEFAULT_RSSI -91 // this is an arbitrary value for now\n+#define DEFAULT_RSSI -50 // this is an arbitrary value for now\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. default rssi value is -50.
|
491,595 |
29.08.2018 14:59:54
| -7,200 |
4af5ce55c5ee2f20025cc0300184595dabd3dfc3
|
There are limit number of gpio on FPGA board. map (isr debugpin and fsm debugpin) to gpio 8 and 9 where is available to plugin wires for debugging (checkout GPIO bank configuration and UCF pinout file).
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/debugpins.c",
"new_path": "bsp/boards/scum/debugpins.c",
"diff": "@@ -23,15 +23,15 @@ void debugpins_init(void) {\n}\nvoid debugpins_frame_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x1000;\n+ // GPIO_REG__OUTPUT ^= 0x1000;\n}\nvoid debugpins_frame_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x1000;\n+ // GPIO_REG__OUTPUT &= ~0x1000;\n}\nvoid debugpins_frame_set(void) {\n- GPIO_REG__OUTPUT |= 0x1000;\n+ //GPIO_REG__OUTPUT |= 0x1000;\n}\nvoid debugpins_slot_toggle(void) {\n@@ -47,15 +47,18 @@ void debugpins_slot_set(void) {\n}\nvoid debugpins_fsm_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x4000;\n+// GPIO_REG__OUTPUT ^= 0x4000;\n+ GPIO_REG__OUTPUT ^= 0x100;\n}\nvoid debugpins_fsm_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x4000;\n+// GPIO_REG__OUTPUT &= ~0x4000;\n+ GPIO_REG__OUTPUT &= ~0x100;\n}\nvoid debugpins_fsm_set(void) {\n- GPIO_REG__OUTPUT |= 0x4000;\n+// GPIO_REG__OUTPUT |= 0x4000;\n+ GPIO_REG__OUTPUT |= 0x100;\n}\n// no enough pin for debugpins task\n@@ -73,15 +76,18 @@ void debugpins_task_set(void) {\n}\nvoid debugpins_isr_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x8000;\n+// GPIO_REG__OUTPUT ^= 0x1000;\n+ GPIO_REG__OUTPUT ^= 0x200;\n}\nvoid debugpins_isr_clr(void) {\n- GPIO_REG__OUTPUT &= ~0x8000;\n+// GPIO_REG__OUTPUT &= ~0x1000;\n+ GPIO_REG__OUTPUT &= ~0x200;\n}\nvoid debugpins_isr_set(void) {\n- GPIO_REG__OUTPUT |= 0x8000;\n+// GPIO_REG__OUTPUT |= 0x1000;\n+ GPIO_REG__OUTPUT |= 0x200;\n}\n// no enough pin for debugpins radio\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/leds.c",
"new_path": "bsp/boards/scum/leds.c",
"diff": "//=========================== public ==========================================\nvoid leds_init(void) {\n- GPIO_REG__OUTPUT &= ~0xF00; // GPIO_REG__OUTPUT = 0bxxxx00000000, all LEDs off\n+// GPIO_REG__OUTPUT &= ~0xF00; // GPIO_REG__OUTPUT = 0bxxxx00000000, all LEDs off\n}\n// 0 <H17>\nvoid leds_error_on(void) {\n- GPIO_REG__OUTPUT |= 0x100;\n+// GPIO_REG__OUTPUT |= 0x100;\n}\nvoid leds_error_off(void) {\n- GPIO_REG__OUTPUT &= ~0x100;\n+// GPIO_REG__OUTPUT &= ~0x100;\n}\nvoid leds_error_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x100;\n+// GPIO_REG__OUTPUT ^= 0x100;\n}\nuint8_t leds_error_isOn(void) {\nreturn (uint8_t)(GPIO_REG__OUTPUT & 0x100);\n@@ -36,13 +36,13 @@ uint8_t leds_error_isOn(void) {\n// 1 <K15>\nvoid leds_radio_on(void) {\n- GPIO_REG__OUTPUT |= 0x200;\n+// GPIO_REG__OUTPUT |= 0x200;\n}\nvoid leds_radio_off(void) {\n- GPIO_REG__OUTPUT &= ~0x200;\n+// GPIO_REG__OUTPUT &= ~0x200;\n}\nvoid leds_radio_toggle(void) {\n- GPIO_REG__OUTPUT ^= 0x200;\n+// GPIO_REG__OUTPUT ^= 0x200;\n}\nuint8_t leds_radio_isOn(void) {\nreturn (uint8_t)(GPIO_REG__OUTPUT & 0x200)>>1;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. There are limit number of gpio on FPGA board. map (isr debugpin and fsm debugpin) to gpio 8 and 9 where is available to plugin wires for debugging (checkout GPIO bank configuration and UCF pinout file).
|
491,595 |
29.08.2018 15:01:59
| -7,200 |
a8314290eb8731ca80ddd4f897e3f3ee40257768
|
update the timing for scumv3b design.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/board_info.h",
"new_path": "bsp/boards/scum/board_info.h",
"diff": "@@ -36,8 +36,7 @@ to return the board's description.\n// with the setup of FPGA board +teensy, the rftimer clock is\n// 20MHz divided by 255 (around 78431Hz), the following code is converting\n-// between 32768Hz and 78431Hz, the ratio between them is around\n-// the radio bewteen 23 and 55\n+// between 32768Hz and 78431Hz, the ratio between them is around 2 and 5\n// NOTICE:\n// 1) 255 is the maxium value can be divided.\n// 2) on FPGA, 20MHz clock can't be slow down.\n@@ -49,10 +48,10 @@ to return the board's description.\n// this is called when require to WRITE the RFTIMER counter/compare registers,\n// where the value is going to be multiplied.\n-#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*55/23\n+#define TIMER_COUNTER_CONVERT_32K_TO_RFTIMER_CLK(value) value*5/2\n// this is called when require to READ the RFTIMER counter/compare registers,\n// where the value is going to be divided.\n-#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*23/55\n+#define TIMER_COUNTER_CONVERT_RFTIMER_CLK_TO_32K(value) value*2/5\n//===== radio\n@@ -63,13 +62,13 @@ to return the board's description.\n#define SLOTDURATION 15 // in miliseconds\n//// time-slot related\n-#define PORT_TsSlotDuration 491 // 491 ticks = 15ms @32768Hz\n-#define PORT_maxTxDataPrepare 66 // 66 ticks = 2013us @32768Hz\n+#define PORT_TsSlotDuration 817 // 491 ticks = 15ms @32768Hz\n+#define PORT_maxTxDataPrepare 100 // 66 ticks = 2013us @32768Hz\n#define PORT_maxRxAckPrepare 20 // 20 ticks = 610us @32768Hz\n#define PORT_maxRxDataPrepare 33 // 33 ticks = 1006us @32768Hz\n-#define PORT_maxTxAckPrepare 30 // 30 ticks = 915us @32768Hz\n+#define PORT_maxTxAckPrepare 45 // 30 ticks = 915us @32768Hz\n// radio speed related\n-#define PORT_delayTx 5 // 5 ticks = 152us @32768hz\n+#define PORT_delayTx 20 // 5 ticks = 152us @32768hz\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n@@ -78,8 +77,10 @@ to return the board's description.\n//===== SCuM speicification\n-// #define SLOT_FSM_IMPLEMENTATION_SINGLE_COMPARE_TIMER_INTERRUPT\n-#define SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+#define SLOT_FSM_IMPLEMENTATION_SINGLE_COMPARE_TIMER_INTERRUPT\n+// #define SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+\n+//#define DAGROOT\n//=========================== typedef ========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/scum/eui64.c",
"new_path": "bsp/boards/scum/eui64.c",
"diff": "#include \"string.h\"\n#include \"eui64.h\"\n+#include \"board_info.h\"\n//=========================== defines =========================================\n//=========================== variables =======================================\n+#ifdef DAGROOT\n+const uint8_t eui64[8] = {0x00,0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x88};\n+#else\nconst uint8_t eui64[8] = {0x00,0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77};\n+#endif\n//=========================== prototypes ======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -179,7 +179,7 @@ enum ieee154e_atomicdurations_enum {\ndelayTx = PORT_delayTx, // between GO signal and SFD\ndelayRx = PORT_delayRx, // between GO signal and start listening\n// radio watchdog\n- wdRadioTx = 33, // 1000us (needs to be >delayTx) (SCuM need a larger value, 43 is tested and works)\n+ wdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)\nwdDataDuration = 164, // 5000us (measured 4280us with max payload)\n#if SLOTDURATION==10\nwdAckDuration = 80, // 2400us (measured 1000us)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. update the timing for scumv3b design.
|
491,595 |
29.08.2018 15:06:54
| -7,200 |
89601efdd4fadcd023418653c79a6bd394cf7d2c
|
setup radio at each slot before joining the network.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -557,6 +557,15 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// I'm listening last slot\nieee154e_stats.numTicsOn += ieee154e_vars.slotDuration;\nieee154e_stats.numTicsTotal += ieee154e_vars.slotDuration;\n+\n+#ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT\n+ sctimer_setCapture(ACTION_RX_SFD_DONE);\n+ sctimer_setCapture(ACTION_RX_DONE);\n+#endif\n+\n+ // switch on the radio in Rx mode.\n+ radio_rxEnable();\n+ radio_rxNow();\n}\n// if I'm already in S_SYNCLISTEN, while not synchronized,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. setup radio at each slot before joining the network.
|
491,595 |
29.08.2018 18:15:35
| -7,200 |
72d2cd11c0a9be579cb9ca6e62a144f4a3ec526b
|
add 01bsp_action_timer_radio project.
|
[
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_action_timer_radio/01bsp_action_timer_radio.c",
"diff": "+/**\n+\\brief This program shows the use of the \"radio\" bsp module using action timer\n+that scum provide.\n+\n+With this project, SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT need to be\n+defined in board_info.h, or this project doesn't compile.\n+\n+This project is to verify the StartOfFrame interrupt is not triggered when\n+schedule Tx_SEND command with a compare timer.\n+\n+\\author Tengfei Chang <tengfei.chang@inria.fr>, August 2018.\n+*/\n+\n+#include \"board.h\"\n+#include \"radio.h\"\n+#include \"leds.h\"\n+#include \"sctimer.h\"\n+#include \"debugpins.h\"\n+#include \"memory_map.h\"\n+\n+//=========================== defines =========================================\n+\n+#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n+#define CHANNEL 11 ///< 11=2.405GHz\n+#define TIMER_PERIOD 0xffff ///< 0xffff = 2s@32kHz\n+#define ID 0x99 ///< byte sent in the packets\n+\n+// FSM timer durations (combinations of atomic durations)\n+// TX\n+#define DURATION_tt1 131-PORT_delayTx-PORT_maxTxDataPrepare\n+#define DURATION_tt2 131-PORT_delayTx\n+#define DURATION_tt3 131-PORT_delayTx+33\n+#define DURATION_tt4 164\n+#define DURATION_tt5 151-16-delayRx-PORT_maxRxAckPrepare\n+#define DURATION_tt6 151-16-delayRx\n+#define DURATION_tt7 151+16\n+#define DURATION_tt8 PORT_maxTxAckPrepare\n+// RX\n+#define DURATION_rt1 131-36-PORT_maxRxDataPrepare\n+#define DURATION_rt2 131-36\n+#define DURATION_rt3 131+36\n+#define DURATION_rt4 164\n+#define DURATION_rt5 151-PORT_delayTx-PORT_maxTxAckPrepare\n+#define DURATION_rt6 151-PORT_delayTx\n+#define DURATION_rt7 151-PORT_delayTx+33\n+#define DURATION_rt8 PORT_maxTxAckPrepare\n+\n+//=========================== variables =======================================\n+\n+enum {\n+ APP_FLAG_START_FRAME = 0x01,\n+ APP_FLAG_END_FRAME = 0x02,\n+ APP_FLAG_TIMER = 0x04,\n+};\n+\n+typedef enum {\n+ APP_STATE_TX = 0x01,\n+ APP_STATE_RX = 0x02,\n+ APP_STATE_READY = 0x04,\n+ APP_STATE_DELAY = 0x08,\n+} app_state_t;\n+\n+typedef struct {\n+ uint8_t num_startFrame;\n+ uint8_t num_endFrame;\n+ uint8_t num_timer;\n+} app_dbg_t;\n+\n+app_dbg_t app_dbg;\n+\n+typedef struct {\n+ uint8_t flags;\n+ app_state_t state;\n+ uint8_t packet[LENGTH_PACKET];\n+ uint8_t packet_len;\n+ int8_t rxpk_rssi;\n+ uint8_t rxpk_lqi;\n+ bool rxpk_crc;\n+ uint32_t referenceTime;\n+} app_vars_t;\n+\n+app_vars_t app_vars;\n+\n+//=========================== prototypes ======================================\n+\n+void cb_startFrame(PORT_TIMER_WIDTH timestamp);\n+void cb_endFrame(PORT_TIMER_WIDTH timestamp);\n+void cb_timer(void);\n+void cb_action_timer(void);\n+\n+//=========================== main ============================================\n+\n+/**\n+\\brief The program starts executing here.\n+*/\n+int mote_main(void) {\n+ uint8_t i;\n+\n+ // clear local variables\n+ memset(&app_vars,0,sizeof(app_vars_t));\n+\n+ // initialize board\n+ board_init();\n+\n+ // add callback functions radio\n+ radio_setStartFrameCb(cb_startFrame);\n+ radio_setEndFrameCb(cb_endFrame);\n+\n+ // prepare packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+ for (i=0;i<app_vars.packet_len;i++) {\n+ app_vars.packet[i] = ID;\n+ }\n+\n+ // start bsp timer\n+ sctimer_set_callback(cb_timer);\n+ sctimer_set_actionCallback(cb_action_timer);\n+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);\n+ sctimer_enable();\n+\n+ // prepare radio\n+ radio_rfOn();\n+ radio_setFrequency(CHANNEL);\n+\n+ // switch in RX by default\n+ radio_rxEnable_scum();\n+ app_vars.state = APP_STATE_RX;\n+\n+ // start by a transmit\n+ app_vars.flags |= APP_FLAG_TIMER;\n+\n+ while (1) {\n+\n+ // sleep while waiting for at least one of the flags to be set\n+ while (app_vars.flags==0x00) {\n+ board_sleep();\n+ }\n+\n+ // handle and clear every flag\n+ while (app_vars.flags) {\n+\n+\n+ //==== APP_FLAG_START_FRAME (TX or RX)\n+\n+ if (app_vars.flags & APP_FLAG_START_FRAME) {\n+ // start of frame\n+\n+ switch (app_vars.state) {\n+ case APP_STATE_RX:\n+ // started receiving a packet\n+\n+ // led\n+ leds_error_on();\n+ break;\n+ case APP_STATE_TX:\n+ // started sending a packet\n+\n+ // led\n+ leds_sync_on();\n+ break;\n+ }\n+\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_START_FRAME;\n+ }\n+\n+\n+ //==== APP_FLAG_END_FRAME (TX or RX)\n+\n+ if (app_vars.flags & APP_FLAG_END_FRAME) {\n+ // end of frame\n+\n+ switch (app_vars.state) {\n+\n+ case APP_STATE_RX:\n+\n+ // done receiving a packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+\n+ // get packet from radio\n+ radio_getReceivedFrame(\n+ app_vars.packet,\n+ &app_vars.packet_len,\n+ sizeof(app_vars.packet),\n+ &app_vars.rxpk_rssi,\n+ &app_vars.rxpk_lqi,\n+ &app_vars.rxpk_crc\n+ );\n+\n+ // led\n+ leds_error_off();\n+ break;\n+ case APP_STATE_TX:\n+ // done sending a packet\n+\n+ // switch to RX mode\n+ radio_rxEnable();\n+ app_vars.state = APP_STATE_RX;\n+\n+ // led\n+ leds_sync_off();\n+ break;\n+ }\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_END_FRAME;\n+ }\n+\n+\n+ //==== APP_FLAG_TIMER\n+\n+ if (app_vars.flags & APP_FLAG_TIMER) {\n+ // timer fired\n+\n+ if (app_vars.state==APP_STATE_RX) {\n+ // stop listening\n+ radio_rfOff();\n+\n+ // prepare packet\n+ app_vars.packet_len = sizeof(app_vars.packet);\n+ for (i=0;i<app_vars.packet_len;i++) {\n+ app_vars.packet[i] = ID;\n+ }\n+\n+ // start transmitting packet\n+ radio_loadPacket_prepare(app_vars.packet,app_vars.packet_len);\n+ // 1. schedule timer for loading packet\n+ sctimer_scheduleActionIn(\n+ ACTION_LOAD_PACKET,\n+ app_vars.referenceTime+DURATION_tt1\n+ );\n+ // 2. schedule timer for sending packet\n+ sctimer_scheduleActionIn(\n+ ACTION_SEND_PACKET,\n+ app_vars.referenceTime+DURATION_tt2\n+ );\n+\n+ sctimer_setCapture(ACTION_TX_SFD_DONE);\n+ sctimer_setCapture(ACTION_TX_SEND_DONE);\n+\n+ app_vars.state = APP_STATE_READY;\n+ }\n+\n+ // clear flag\n+ app_vars.flags &= ~APP_FLAG_TIMER;\n+ }\n+ }\n+ }\n+}\n+\n+//=========================== callbacks =======================================\n+\n+void cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n+ // set flag\n+ app_vars.flags |= APP_FLAG_START_FRAME;\n+\n+ // update debug stats\n+ app_dbg.num_startFrame++;\n+\n+ UART_REG__TX_DATA = 'S';\n+ UART_REG__TX_DATA = 'o';\n+ UART_REG__TX_DATA = 'F';\n+\n+}\n+\n+void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n+ // set flag\n+ app_vars.flags |= APP_FLAG_END_FRAME;\n+\n+ // update debug stats\n+ app_dbg.num_endFrame++;\n+\n+ UART_REG__TX_DATA = 'E';\n+ UART_REG__TX_DATA = 'o';\n+ UART_REG__TX_DATA = 'F';\n+}\n+\n+void cb_timer(void) {\n+\n+ UART_REG__TX_DATA = 'T';\n+ UART_REG__TX_DATA = 'i';\n+ UART_REG__TX_DATA = 'm';\n+ UART_REG__TX_DATA = 'e';\n+ UART_REG__TX_DATA = 'r';\n+\n+ debugpins_fsm_clr();\n+\n+ // set flag\n+ app_vars.flags |= APP_FLAG_TIMER;\n+\n+ // update debug stats\n+ app_dbg.num_timer++;\n+\n+ app_vars.referenceTime = sctimer_readCounter();\n+\n+ sctimer_setCompare(app_vars.referenceTime+TIMER_PERIOD);\n+}\n+\n+void cb_action_timer(void){\n+\n+ debugpins_fsm_toggle();\n+\n+ UART_REG__TX_DATA = 'A';\n+ UART_REG__TX_DATA = 'C';\n+ UART_REG__TX_DATA = 'T';\n+ UART_REG__TX_DATA = 'i';\n+ UART_REG__TX_DATA = 'o';\n+ UART_REG__TX_DATA = 'n';\n+\n+ if (app_vars.state & APP_STATE_READY){\n+ UART_REG__TX_DATA = '0'+APP_STATE_READY;\n+ app_vars.state = APP_STATE_DELAY;\n+ return;\n+ }\n+\n+ if (app_vars.state & APP_STATE_DELAY){\n+ UART_REG__TX_DATA = '0'+APP_STATE_DELAY;\n+ app_vars.state = APP_STATE_TX;\n+ return;\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/scum/01bsp_action_timer_radio/01bsp_action_timer_radio.uvprojx",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n+<Project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"project_projx.xsd\">\n+\n+ <SchemaVersion>2.1</SchemaVersion>\n+\n+ <Header>### uVision Project, (C) Keil Software</Header>\n+\n+ <Targets>\n+ <Target>\n+ <TargetName>Target SCuM</TargetName>\n+ <ToolsetNumber>0x4</ToolsetNumber>\n+ <ToolsetName>ARM-ADS</ToolsetName>\n+ <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>\n+ <uAC6>0</uAC6>\n+ <TargetOption>\n+ <TargetCommonOption>\n+ <Device>ARMCM0</Device>\n+ <Vendor>ARM</Vendor>\n+ <PackID>ARM.CMSIS.5.3.0</PackID>\n+ <PackURL>http://www.keil.com/pack/</PackURL>\n+ <Cpu>IRAM(0x20000000,0x20000) IROM(0x00000000,0x40000) CPUTYPE(\"Cortex-M0\") CLOCK(12000000) ESEL ELITTLE</Cpu>\n+ <FlashUtilSpec></FlashUtilSpec>\n+ <StartupFile></StartupFile>\n+ <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0$Device\\ARM\\Flash\\NEW_DEVICE.FLM))</FlashDriverDll>\n+ <DeviceId>0</DeviceId>\n+ <RegisterFile>$$Device:ARMCM0$Device\\ARM\\ARMCM0\\Include\\ARMCM0.h</RegisterFile>\n+ <MemoryEnv></MemoryEnv>\n+ <Cmp></Cmp>\n+ <Asm></Asm>\n+ <Linker></Linker>\n+ <OHString></OHString>\n+ <InfinionOptionDll></InfinionOptionDll>\n+ <SLE66CMisc></SLE66CMisc>\n+ <SLE66AMisc></SLE66AMisc>\n+ <SLE66LinkerMisc></SLE66LinkerMisc>\n+ <SFDFile>$$Device:ARMCM0$Device\\ARM\\SVD\\ARMCM0.svd</SFDFile>\n+ <bCustSvd>0</bCustSvd>\n+ <UseEnv>0</UseEnv>\n+ <BinPath></BinPath>\n+ <IncludePath></IncludePath>\n+ <LibPath></LibPath>\n+ <RegisterFilePath></RegisterFilePath>\n+ <DBRegisterFilePath></DBRegisterFilePath>\n+ <TargetStatus>\n+ <Error>0</Error>\n+ <ExitCodeStop>0</ExitCodeStop>\n+ <ButtonStop>0</ButtonStop>\n+ <NotGenerated>0</NotGenerated>\n+ <InvalidFlash>1</InvalidFlash>\n+ </TargetStatus>\n+ <OutputDirectory>.\\Objects\\</OutputDirectory>\n+ <OutputName>01bsp_action_timer_radio</OutputName>\n+ <CreateExecutable>1</CreateExecutable>\n+ <CreateLib>0</CreateLib>\n+ <CreateHexFile>1</CreateHexFile>\n+ <DebugInformation>1</DebugInformation>\n+ <BrowseInformation>1</BrowseInformation>\n+ <ListingPath>.\\Listings\\</ListingPath>\n+ <HexFormatSelection>1</HexFormatSelection>\n+ <Merge32K>0</Merge32K>\n+ <CreateBatchFile>1</CreateBatchFile>\n+ <BeforeCompile>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopU1X>0</nStopU1X>\n+ <nStopU2X>0</nStopU2X>\n+ </BeforeCompile>\n+ <BeforeMake>\n+ <RunUserProg1>0</RunUserProg1>\n+ <RunUserProg2>0</RunUserProg2>\n+ <UserProg1Name></UserProg1Name>\n+ <UserProg2Name></UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopB1X>0</nStopB1X>\n+ <nStopB2X>0</nStopB2X>\n+ </BeforeMake>\n+ <AfterMake>\n+ <RunUserProg1>1</RunUserProg1>\n+ <RunUserProg2>1</RunUserProg2>\n+ <UserProg1Name>fromelf --bin .\\Objects\\01bsp_action_timer_radio.axf -o .\\Objects\\01bsp_action_timer_radio.bin</UserProg1Name>\n+ <UserProg2Name>fromelf -cvf .\\Objects\\01bsp_action_timer_radio.axf -o .\\Objects\\disasm.txt</UserProg2Name>\n+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>\n+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>\n+ <nStopA1X>0</nStopA1X>\n+ <nStopA2X>0</nStopA2X>\n+ </AfterMake>\n+ <SelectedForBatchBuild>0</SelectedForBatchBuild>\n+ <SVCSIdString></SVCSIdString>\n+ </TargetCommonOption>\n+ <CommonProperty>\n+ <UseCPPCompiler>0</UseCPPCompiler>\n+ <RVCTCodeConst>0</RVCTCodeConst>\n+ <RVCTZI>0</RVCTZI>\n+ <RVCTOtherData>0</RVCTOtherData>\n+ <ModuleSelection>0</ModuleSelection>\n+ <IncludeInBuild>1</IncludeInBuild>\n+ <AlwaysBuild>0</AlwaysBuild>\n+ <GenerateAssemblyFile>0</GenerateAssemblyFile>\n+ <AssembleAssemblyFile>0</AssembleAssemblyFile>\n+ <PublicsOnly>0</PublicsOnly>\n+ <StopOnExitCode>3</StopOnExitCode>\n+ <CustomArgument></CustomArgument>\n+ <IncludeLibraryModules></IncludeLibraryModules>\n+ <ComprImg>1</ComprImg>\n+ </CommonProperty>\n+ <DllOption>\n+ <SimDllName>SARMCM3.DLL</SimDllName>\n+ <SimDllArguments> </SimDllArguments>\n+ <SimDlgDll>DARMCM1.DLL</SimDlgDll>\n+ <SimDlgDllArguments>-pCM0</SimDlgDllArguments>\n+ <TargetDllName>SARMCM3.DLL</TargetDllName>\n+ <TargetDllArguments> </TargetDllArguments>\n+ <TargetDlgDll>TARMCM1.DLL</TargetDlgDll>\n+ <TargetDlgDllArguments>-pCM0</TargetDlgDllArguments>\n+ </DllOption>\n+ <DebugOption>\n+ <OPTHX>\n+ <HexSelection>1</HexSelection>\n+ <HexRangeLowAddress>0</HexRangeLowAddress>\n+ <HexRangeHighAddress>0</HexRangeHighAddress>\n+ <HexOffset>0</HexOffset>\n+ <Oh166RecLen>16</Oh166RecLen>\n+ </OPTHX>\n+ </DebugOption>\n+ <Utilities>\n+ <Flash1>\n+ <UseTargetDll>1</UseTargetDll>\n+ <UseExternalTool>0</UseExternalTool>\n+ <RunIndependent>0</RunIndependent>\n+ <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>\n+ <Capability>1</Capability>\n+ <DriverSelection>4096</DriverSelection>\n+ </Flash1>\n+ <bUseTDR>1</bUseTDR>\n+ <Flash2>BIN\\UL2CM3.DLL</Flash2>\n+ <Flash3>\"\" ()</Flash3>\n+ <Flash4></Flash4>\n+ <pFcarmOut></pFcarmOut>\n+ <pFcarmGrp></pFcarmGrp>\n+ <pFcArmRoot></pFcArmRoot>\n+ <FcArmLst>0</FcArmLst>\n+ </Utilities>\n+ <TargetArmAds>\n+ <ArmAdsMisc>\n+ <GenerateListings>0</GenerateListings>\n+ <asHll>1</asHll>\n+ <asAsm>1</asAsm>\n+ <asMacX>1</asMacX>\n+ <asSyms>1</asSyms>\n+ <asFals>1</asFals>\n+ <asDbgD>1</asDbgD>\n+ <asForm>1</asForm>\n+ <ldLst>0</ldLst>\n+ <ldmm>1</ldmm>\n+ <ldXref>1</ldXref>\n+ <BigEnd>0</BigEnd>\n+ <AdsALst>1</AdsALst>\n+ <AdsACrf>1</AdsACrf>\n+ <AdsANop>0</AdsANop>\n+ <AdsANot>0</AdsANot>\n+ <AdsLLst>1</AdsLLst>\n+ <AdsLmap>1</AdsLmap>\n+ <AdsLcgr>1</AdsLcgr>\n+ <AdsLsym>1</AdsLsym>\n+ <AdsLszi>1</AdsLszi>\n+ <AdsLtoi>1</AdsLtoi>\n+ <AdsLsun>1</AdsLsun>\n+ <AdsLven>1</AdsLven>\n+ <AdsLsxf>1</AdsLsxf>\n+ <RvctClst>0</RvctClst>\n+ <GenPPlst>0</GenPPlst>\n+ <AdsCpuType>\"Cortex-M0\"</AdsCpuType>\n+ <RvctDeviceName></RvctDeviceName>\n+ <mOS>0</mOS>\n+ <uocRom>0</uocRom>\n+ <uocRam>0</uocRam>\n+ <hadIROM>1</hadIROM>\n+ <hadIRAM>1</hadIRAM>\n+ <hadXRAM>0</hadXRAM>\n+ <uocXRam>0</uocXRam>\n+ <RvdsVP>0</RvdsVP>\n+ <hadIRAM2>0</hadIRAM2>\n+ <hadIROM2>0</hadIROM2>\n+ <StupSel>8</StupSel>\n+ <useUlib>0</useUlib>\n+ <EndSel>1</EndSel>\n+ <uLtcg>0</uLtcg>\n+ <nSecure>0</nSecure>\n+ <RoSelD>3</RoSelD>\n+ <RwSelD>3</RwSelD>\n+ <CodeSel>0</CodeSel>\n+ <OptFeed>0</OptFeed>\n+ <NoZi1>0</NoZi1>\n+ <NoZi2>0</NoZi2>\n+ <NoZi3>0</NoZi3>\n+ <NoZi4>0</NoZi4>\n+ <NoZi5>0</NoZi5>\n+ <Ro1Chk>0</Ro1Chk>\n+ <Ro2Chk>0</Ro2Chk>\n+ <Ro3Chk>0</Ro3Chk>\n+ <Ir1Chk>1</Ir1Chk>\n+ <Ir2Chk>0</Ir2Chk>\n+ <Ra1Chk>0</Ra1Chk>\n+ <Ra2Chk>0</Ra2Chk>\n+ <Ra3Chk>0</Ra3Chk>\n+ <Im1Chk>1</Im1Chk>\n+ <Im2Chk>0</Im2Chk>\n+ <OnChipMemories>\n+ <Ocm1>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm1>\n+ <Ocm2>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm2>\n+ <Ocm3>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm3>\n+ <Ocm4>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm4>\n+ <Ocm5>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm5>\n+ <Ocm6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </Ocm6>\n+ <IRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x20000</Size>\n+ </IRAM>\n+ <IROM>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x40000</Size>\n+ </IROM>\n+ <XRAM>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </XRAM>\n+ <OCR_RVCT1>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT1>\n+ <OCR_RVCT2>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT2>\n+ <OCR_RVCT3>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT3>\n+ <OCR_RVCT4>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT4>\n+ <OCR_RVCT5>\n+ <Type>1</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT5>\n+ <OCR_RVCT6>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT6>\n+ <OCR_RVCT7>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT7>\n+ <OCR_RVCT8>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT8>\n+ <OCR_RVCT9>\n+ <Type>0</Type>\n+ <StartAddress>0x20000000</StartAddress>\n+ <Size>0x10000</Size>\n+ </OCR_RVCT9>\n+ <OCR_RVCT10>\n+ <Type>0</Type>\n+ <StartAddress>0x0</StartAddress>\n+ <Size>0x0</Size>\n+ </OCR_RVCT10>\n+ </OnChipMemories>\n+ <RvctStartVector></RvctStartVector>\n+ </ArmAdsMisc>\n+ <Cads>\n+ <interw>1</interw>\n+ <Optim>1</Optim>\n+ <oTime>0</oTime>\n+ <SplitLS>0</SplitLS>\n+ <OneElfS>1</OneElfS>\n+ <Strict>0</Strict>\n+ <EnumInt>0</EnumInt>\n+ <PlainCh>0</PlainCh>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <wLevel>2</wLevel>\n+ <uThumb>0</uThumb>\n+ <uSurpInc>0</uSurpInc>\n+ <uC99>0</uC99>\n+ <uGnu>0</uGnu>\n+ <useXO>0</useXO>\n+ <v6Lang>1</v6Lang>\n+ <v6LangP>1</v6LangP>\n+ <vShortEn>1</vShortEn>\n+ <vShortWch>1</vShortWch>\n+ <v6Lto>0</v6Lto>\n+ <v6WtE>0</v6WtE>\n+ <v6Rtti>0</v6Rtti>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath>..\\..\\..\\bsp\\boards;..\\..\\..\\bsp\\boards\\scum</IncludePath>\n+ </VariousControls>\n+ </Cads>\n+ <Aads>\n+ <interw>1</interw>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <thumb>1</thumb>\n+ <SplitLS>0</SplitLS>\n+ <SwStkChk>0</SwStkChk>\n+ <NoWarn>0</NoWarn>\n+ <uSurpInc>0</uSurpInc>\n+ <useXO>0</useXO>\n+ <uClangAs>0</uClangAs>\n+ <VariousControls>\n+ <MiscControls></MiscControls>\n+ <Define></Define>\n+ <Undefine></Undefine>\n+ <IncludePath></IncludePath>\n+ </VariousControls>\n+ </Aads>\n+ <LDads>\n+ <umfTarg>1</umfTarg>\n+ <Ropi>0</Ropi>\n+ <Rwpi>0</Rwpi>\n+ <noStLib>0</noStLib>\n+ <RepFail>1</RepFail>\n+ <useFile>0</useFile>\n+ <TextAddressRange>0x00000000</TextAddressRange>\n+ <DataAddressRange>0x20000000</DataAddressRange>\n+ <pXoBase></pXoBase>\n+ <ScatterFile></ScatterFile>\n+ <IncludeLibs></IncludeLibs>\n+ <IncludeLibsPath></IncludeLibsPath>\n+ <Misc></Misc>\n+ <LinkerInputFile></LinkerInputFile>\n+ <DisabledWarnings></DisabledWarnings>\n+ </LDads>\n+ </TargetArmAds>\n+ </TargetOption>\n+ <Groups>\n+ <Group>\n+ <GroupName>application</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>01bsp_action_timer_radio.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>.\\01bsp_action_timer_radio.c</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>startUp</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>cm0dsasm.s</FileName>\n+ <FileType>2</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\cm0dsasm.s</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>boards</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>board.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\board.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\debugpins.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\eui64.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>leds.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\leds.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\radio.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\uart.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\sctimer.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ <Group>\n+ <GroupName>scum</GroupName>\n+ <Files>\n+ <File>\n+ <FileName>leds.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\leds.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>memory_map.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\memory_map.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>board_info.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board_info.h</FilePath>\n+ </File>\n+ <File>\n+ <FileName>board.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\board.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>uart.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\uart.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>debugpins.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\debugpins.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>radio.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\radio.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>eui64.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\eui64.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>sctimer.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\sctimer.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.c</FileName>\n+ <FileType>1</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.c</FilePath>\n+ </File>\n+ <File>\n+ <FileName>scm3_hardware_interface.h</FileName>\n+ <FileType>5</FileType>\n+ <FilePath>..\\..\\..\\bsp\\boards\\scum\\scm3_hardware_interface.h</FilePath>\n+ </File>\n+ </Files>\n+ </Group>\n+ </Groups>\n+ </Target>\n+ </Targets>\n+\n+ <RTE>\n+ <apis/>\n+ <components/>\n+ <files/>\n+ </RTE>\n+\n+</Project>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
SCUM-30. add 01bsp_action_timer_radio project.
|
491,595 |
13.09.2018 10:12:00
| -7,200 |
319e4e9a8cb4bd10d5dcbc805feae331fc2116f1
|
change it to PA6 as the bootload active pin.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/startup_iar.c",
"new_path": "bsp/boards/openmote-b-/startup_iar.c",
"diff": "#include <stdint.h>\n#define FLASH_START_ADDR 0x00200000\n-#define BOOTLOADER_BACKDOOR_ENABLE 0xF7FFFFFF // ENABLED: PORT A, PIN 6, LOW\n+#define BOOTLOADER_BACKDOOR_ENABLE 0xF6FFFFFF // ENABLED: PORT A, PIN 6, LOW\n#define BOOTLOADER_BACKDOOR_DISABLE 0xEFFFFFFF\n#define SYS_CTRL_EMUOVR 0x400D20B4\n#define SYS_CTRL_I_MAP 0x400D2098\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. change it to PA6 as the bootload active pin.
|
491,595 |
13.09.2018 20:17:43
| -7,200 |
62c85ae46fb8f99f9bdc58a60cbd2ec1c6812d1c
|
update button and antennae GPIO configuration according to pere's commit:
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/board.c",
"new_path": "bsp/boards/openmote-b-/board.c",
"diff": "#include \"uart.h\"\n#include \"cryptoengine.h\"\n-//=========================== variables =======================================\n+//=========================== defines =======================================\n-#define BSP_BUTTON_BASE ( GPIO_C_BASE )\n-#define BSP_BUTTON_USER ( GPIO_PIN_3 )\n+#define BSP_BUTTON_BASE ( GPIO_D_BASE )\n+#define BSP_BUTTON_USER ( GPIO_PIN_5 )\n+\n+#define BSP_ANTENNA_BASE GPIO_D_BASE\n+#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_3 //!< PD4 -- 2.4ghz\n+#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_4 //!< PD3 -- subghz\n-#ifdef REVA1 //Rev.A1 uses SF23 cc2538 which start at diffferent location\n- #define CC2538_FLASH_ADDRESS ( 0x0023F800 )\n-#else\n- #define CC2538_FLASH_ADDRESS ( 0x0027F800 )\n-#endif\n//=========================== prototypes ======================================\nvoid board_timer_init(void);\n@@ -49,16 +48,11 @@ static void gpio_init(void);\nstatic void button_init(void);\nstatic void antenna_init(void);\n-\nstatic void SysCtrlDeepSleepSetting(void);\nstatic void SysCtrlSleepSetting(void);\nstatic void SysCtrlRunSetting(void);\nstatic void SysCtrlWakeupSetting(void);\n-static void GPIO_C_Handler(void);\n-\n-bool user_button_initialized;\n-\n//=========================== main ============================================\nextern int mote_main(void);\n@@ -70,7 +64,6 @@ int main(void) {\n//=========================== public ==========================================\nvoid board_init(void) {\n- user_button_initialized = FALSE;\ngpio_init();\nclock_init();\n@@ -88,7 +81,7 @@ void board_init(void) {\n}\nvoid antenna_init(void) {\n- //use cc2538 2.4ghz radio\n+ // By default use CC2538 2.4 GHz radio\nGPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);\nGPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0);\n}\n@@ -154,17 +147,12 @@ void board_reset(void) {\n//=========================== private =========================================\nstatic void gpio_init(void) {\n- /* Set GPIOs as output */\n- GPIOPinTypeGPIOOutput(GPIO_A_BASE, 0xFF);\n- GPIOPinTypeGPIOOutput(GPIO_B_BASE, 0xFF);\n- GPIOPinTypeGPIOOutput(GPIO_C_BASE, 0xFF);\n- GPIOPinTypeGPIOOutput(GPIO_D_BASE, 0xFF);\n-\n- /* Initialize GPIOs to low */\n- GPIOPinWrite(GPIO_A_BASE, 0xFF, 0x00);\n- GPIOPinWrite(GPIO_B_BASE, 0xFF, 0x00);\n- GPIOPinWrite(GPIO_C_BASE, 0xFF, 0x00);\n- GPIOPinWrite(GPIO_D_BASE, 0xFF, 0x00);\n+\n+ // all to input\n+ GPIOPinTypeGPIOInput(GPIO_A_BASE, 0xFF);\n+ GPIOPinTypeGPIOInput(GPIO_B_BASE, 0xFF);\n+ GPIOPinTypeGPIOInput(GPIO_C_BASE, 0xFF);\n+ GPIOPinTypeGPIOInput(GPIO_D_BASE, 0xFF);\n}\nstatic void clock_init(void) {\n@@ -218,13 +206,13 @@ static void button_init(void) {\nGPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_BUTTON_USER);\nGPIOIntTypeSet(BSP_BUTTON_BASE, BSP_BUTTON_USER, GPIO_FALLING_EDGE);\n- /* Register the interrupt */\n- GPIOPortIntRegister(BSP_BUTTON_BASE, GPIO_C_Handler);\n+ GPIOIntWakeupEnable(GPIO_IWE_PORT_D);\n+\n+ GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n/* Clear and enable the interrupt */\nGPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);\nGPIOPinIntEnable(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n- user_button_initialized = TRUE;\n}\nstatic void SysCtrlRunSetting(void) {\n@@ -303,22 +291,3 @@ static void SysCtrlWakeupSetting(void) {\n}\n//=========================== interrupt handlers ==============================\n-\n-/**\n- * GPIO_C interrupt handler. User button is GPIO_C_3\n- * Erases a Flash sector to trigger the bootloader backdoor\n- */\n-static void GPIO_C_Handler(void) {\n- if (!user_button_initialized) return;\n- /* Disable the interrupts */\n- IntMasterDisable();\n- leds_all_off();\n-\n- /* Eras the CCA flash page */\n- FlashMainPageErase(CC2538_FLASH_ADDRESS);\n-\n- leds_circular_shift();\n-\n- /* Reset the board */\n- SysCtrlReset();\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/board_info.h",
"new_path": "bsp/boards/openmote-b-/board_info.h",
"diff": "#define NUMSENSORS 7\n-//====== Antenna options ====\n-#define BSP_ANTENNA_BASE GPIO_D_BASE\n-#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n-#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz\n-\n-\n//=========================== typedef ========================================\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. update button and antennae GPIO configuration according to pere's commit: https://github.com/openwsn-berkeley/openwsn-fw/pull/432/files
|
491,595 |
14.09.2018 09:02:41
| -7,200 |
e586867e39ee46cb5a8fe3e71a2508e496c3b62e
|
update openmote-b- bsp driver
|
[
{
"change_type": "DELETE",
"old_path": "bsp/boards/openmote-b-/cc2538sf23.lds",
"new_path": null,
"diff": "-/**\n- * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu)\n- * Pere Tuset (peretuset@openmote.com)\n- * Date: July 2013\n- * Description: CC2538-specific linker script configuration file.\n- */\n-\n-/**\n- * Indicate to the linker the entry point.\n- */\n-ENTRY(ResetISR)\n-\n-/**\n- * RAM is 16 KB retention and 16 KB no retention\n- * NON-RETENTION RAM starts at 0x20000000 with length 0x00004000\n- * RETENTION RAM starts at 0x20004000 with length 0x00004000\n- */\n-MEMORY\n-{\n- FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 0x0003FFD4\n- FLASH_CCA (RX) : ORIGIN = 0x0023FFD4, LENGTH = 12\n- SRAM (RWX) : ORIGIN = 0x20004000, LENGTH = 0x00004000\n-}\n-\n-SECTIONS\n-{\n- .text :\n- {\n- _text = .;\n- KEEP(*(.vectors))\n- *(.text*)\n- *(.rodata*)\n- _etext = .;\n- } > FLASH=0\n-\n- .data :\n- AT (ADDR (.text) + SIZEOF (.text))\n- {\n- _data = .;\n- *(vtable)\n- *(.data*)\n- _edata = .;\n- } > SRAM\n-\n- .ARM.exidx :\n- {\n- *(.ARM.exidx*)\n- } > FLASH\n-\n- .bss :\n- {\n- _bss = .;\n- *(.bss*)\n- *(COMMON)\n- _ebss = .;\n- } > SRAM\n-\n- .flashcca :\n- {\n- KEEP(*(.flashcca))\n- } > FLASH_CCA\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/debugpins.c",
"new_path": "bsp/boards/openmote-b-/debugpins.c",
"diff": "//=========================== defines =========================================\n// Board dbPINS defines\n#define BSP_PINA_BASE GPIO_A_BASE\n-#define BSP_PIND_BASE GPIO_D_BASE\n+#define BSP_PINC_BASE GPIO_C_BASE\n+#define BSP_PINB_BASE GPIO_B_BASE\n-#define BSP_PINA_4 GPIO_PIN_4 //!< PA4 -- frame -RF1.5\n-#define BSP_PINA_5 GPIO_PIN_5 //!< PA5 -- isr -RF1.11\n+#define BSP_PINA_7 GPIO_PIN_7 //!< PA7 -- frame -RF1.5\n+#define BSP_PINC_3 GPIO_PIN_3 //!< PC3 -- isr -RF1.11\n-#define BSP_PIND_3 GPIO_PIN_3 //!< PD3 -- slot -RF1.6\n-#define BSP_PIND_2 GPIO_PIN_2 //!< PD2 -- fsm -RF1.8\n-#define BSP_PIND_1 GPIO_PIN_1 //!< PD1 -- task -RF1.10\n-#define BSP_PIND_0 GPIO_PIN_0 //!< PD0 -- radio -RF1-12\n+#define BSP_PINB_3 GPIO_PIN_3 //!< PB3 -- slot -RF1.6\n+#define BSP_PINB_2 GPIO_PIN_2 //!< PB2 -- fsm -RF1.8\n+#define BSP_PINB_1 GPIO_PIN_1 //!< PB1 -- task -RF1.10\n+#define BSP_PINB_0 GPIO_PIN_0 //!< PB0 -- radio -RF1-12\n//=========================== variables =======================================\n@@ -35,77 +36,79 @@ void bspDBpinToggle(uint32_t base,uint8_t ui8Pin);\n//=========================== public ==========================================\nvoid debugpins_init(void) {\n- GPIOPinTypeGPIOOutput(BSP_PINA_BASE, BSP_PINA_4 | BSP_PINA_5);\n- GPIOPinTypeGPIOOutput(BSP_PIND_BASE, BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1 | BSP_PIND_0);\n+ GPIOPinTypeGPIOOutput(BSP_PINA_BASE, BSP_PINA_7);\n+ GPIOPinTypeGPIOOutput(BSP_PINC_BASE, BSP_PINC_3);\n+ GPIOPinTypeGPIOOutput(BSP_PINB_BASE, BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0);\n- GPIOPinWrite(BSP_PINA_BASE, (BSP_PINA_4 | BSP_PINA_5), 0x00);\n- GPIOPinWrite(BSP_PIND_BASE, (BSP_PIND_3 | BSP_PIND_2 | BSP_PIND_1 | BSP_PIND_0), 0);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, (BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0), 0);\n}\n-// PA4\n+// PA7\nvoid debugpins_frame_toggle(void) {\n- bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_4);\n+ bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_7);\n}\nvoid debugpins_frame_clr(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_4, 0);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0);\n}\nvoid debugpins_frame_set(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_4, BSP_PINA_4);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, BSP_PINA_7);\n}\n-// PD3\n+// PB3\nvoid debugpins_slot_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_3);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_3);\n}\nvoid debugpins_slot_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_3, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, 0);\n}\nvoid debugpins_slot_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_3, BSP_PIND_3);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, BSP_PINB_3);\n}\n-// PD2\n+// PB2\nvoid debugpins_fsm_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_2);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_2);\n}\nvoid debugpins_fsm_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_2, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, 0);\n}\nvoid debugpins_fsm_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_2, BSP_PIND_2);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, BSP_PINB_2);\n}\n-// PD1\n+// PB1\nvoid debugpins_task_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE,BSP_PIND_1);\n+// bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n}\nvoid debugpins_task_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_1, 0);\n+// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n}\nvoid debugpins_task_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_1, BSP_PIND_1);\n+// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n}\n-// PA5\n+// PC3\nvoid debugpins_isr_toggle(void) {\n- bspDBpinToggle(BSP_PINA_BASE, BSP_PINA_5);\n+ bspDBpinToggle(BSP_PINC_BASE, BSP_PINC_3);\n}\nvoid debugpins_isr_clr(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_5, 0);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n}\nvoid debugpins_isr_set(void) {\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_5, BSP_PINA_5);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, BSP_PINC_3);\n}\n-// PD0\n+// PB0\nvoid debugpins_radio_toggle(void) {\n- bspDBpinToggle(BSP_PIND_BASE, BSP_PIND_0);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_0);\n}\nvoid debugpins_radio_clr(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_0, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, 0);\n}\nvoid debugpins_radio_set(void) {\n- GPIOPinWrite(BSP_PIND_BASE, BSP_PIND_0, BSP_PIND_0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, BSP_PINB_0);\n}\n//------------ private ------------//\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/i2c.c",
"new_path": "bsp/boards/openmote-b-/i2c.c",
"diff": "#define I2C_PERIPHERAL ( SYS_CTRL_PERIPH_I2C )\n#define I2C_BASE ( GPIO_B_BASE )\n-#define I2C_SCL ( GPIO_PIN_3 )\n+#define I2C_SCL ( GPIO_PIN_5 )\n#define I2C_SDA ( GPIO_PIN_4 )\n-#define I2C_BAUDRATE ( 100000 )\n-#define I2C_MAX_DELAY_US ( 100000 )\n+#define I2C_BAUDRATE ( 400000 )\n+#define I2C_MAX_DELAY_US ( 400000 )\n//=========================== variables =======================================\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/leds.c",
"new_path": "bsp/boards/openmote-b-/leds.c",
"diff": "@@ -59,34 +59,34 @@ uint8_t leds_error_isOn(void) {\nreturn (uint8_t)(ui32Toggle & BSP_LED_1)>>4;\n}\n-// orange\n+// green\nvoid leds_sync_on(void) {\n- bspLedSet(BSP_LED_2);\n+ bspLedSet(BSP_LED_4);\n}\nvoid leds_sync_off(void) {\n- bspLedClear(BSP_LED_2);\n+ bspLedClear(BSP_LED_4);\n}\nvoid leds_sync_toggle(void) {\n- bspLedToggle(BSP_LED_2);\n+ bspLedToggle(BSP_LED_4);\n}\nuint8_t leds_sync_isOn(void) {\n- uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_2);\n- return (uint8_t)(ui32Toggle & BSP_LED_2)>>5;\n+ uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_4);\n+ return (uint8_t)(ui32Toggle & BSP_LED_4)>>5;\n}\n-// green\n+// orange\nvoid leds_radio_on(void) {\n- bspLedSet(BSP_LED_4);\n+ bspLedSet(BSP_LED_2);\n}\nvoid leds_radio_off(void) {\n- bspLedClear(BSP_LED_4);\n+ bspLedClear(BSP_LED_2);\n}\nvoid leds_radio_toggle(void) {\n- bspLedToggle(BSP_LED_4);\n+ bspLedToggle(BSP_LED_2);\n}\nuint8_t leds_radio_isOn(void) {\n- uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_4);\n- return (uint8_t)(ui32Toggle & BSP_LED_4)>>7;\n+ uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_2);\n+ return (uint8_t)(ui32Toggle & BSP_LED_2)>>7;\n}\n// yellow\n@@ -140,7 +140,7 @@ void leds_circular_shift(void) {\n// incrementally turn LED on\nfor (i=0;i<10;i++) {\nbspLedSet(BSP_LED_1);\n- for (delay=0xffff;delay>0;delay--);\n+ for (delay=0xffff;delay>0;delay--)\nbspLedClear(BSP_LED_1);\nbspLedSet(BSP_LED_2);\nfor (delay=0xffff;delay>0;delay--);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/sctimer.c",
"new_path": "bsp/boards/openmote-b-/sctimer.c",
"diff": "@@ -48,6 +48,8 @@ void sctimer_set_callback(sctimer_cbt cb){\n*/\nvoid sctimer_setCompare(uint32_t val){\nIntEnable(INT_SMTIM);\n+ // the current time is later than the required value, but close enough\n+ // to think we have been too slow to schedule it.\nif (SleepModeTimerCountGet() - val < TIMERLOOP_THRESHOLD){\n// the timer is already late, schedule the ISR right now manually\nIntPendSet(INT_SMTIM);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/startup_iar.c",
"new_path": "bsp/boards/openmote-b-/startup_iar.c",
"diff": "#include <stdint.h>\n#define FLASH_START_ADDR 0x00200000\n-#define BOOTLOADER_BACKDOOR_ENABLE 0xF6FFFFFF // ENABLED: PORT A, PIN 6, LOW\n#define BOOTLOADER_BACKDOOR_DISABLE 0xEFFFFFFF\n+#define BOOTLOADER_BACKDOOR_ENABLE 0xF6FFFFFF // ENABLED: PORT A, PIN 6, LOW\n#define SYS_CTRL_EMUOVR 0x400D20B4\n#define SYS_CTRL_I_MAP 0x400D2098\n@@ -191,7 +191,7 @@ lockPageCCA_t;\n__root const lockPageCCA_t __cca @ \".flashcca\" =\n{\n- BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor disabled\n+ BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled\n0, // Image valid bytes\nFLASH_START_ADDR // Vector table located at flash start address\n};\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-733. update openmote-b- bsp driver
|
491,595 |
14.09.2018 09:41:01
| -7,200 |
49247345d07386425c9e87ace2ab426d9f4fa61d
|
update board configuration.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/board.c",
"new_path": "bsp/boards/openmote-b-/board.c",
"diff": "#include <source/sys_ctrl.h>\n#include \"board.h\"\n+#include \"board_info.h\"\n#include \"debugpins.h\"\n#include \"i2c.h\"\n#include \"leds.h\"\n#define BSP_BUTTON_BASE ( GPIO_D_BASE )\n#define BSP_BUTTON_USER ( GPIO_PIN_5 )\n-#define BSP_ANTENNA_BASE GPIO_D_BASE\n-#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_3 //!< PD4 -- 2.4ghz\n-#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_4 //!< PD3 -- subghz\n-\n//=========================== prototypes ======================================\nvoid board_timer_init(void);\n@@ -76,14 +73,29 @@ void board_init(void) {\nuart_init();\nradio_init();\ni2c_init();\n- sensors_init();\n+\n+ // sensors_init();\ncryptoengine_init();\n}\nvoid antenna_init(void) {\n- // By default use CC2538 2.4 GHz radio\n- GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);\n+ /* Configure GPIO as output */\n+ GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ);\n+ GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ);\n+\n+ /* Use CC2538 antenna by default */\n+ GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0);\n+ GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, BSP_ANTENNA_AT215_24GHZ);\n+}\n+\n+void antenna_cc2538(void) {\n+ GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0);\n+ GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, BSP_ANTENNA_AT215_24GHZ);\n+}\n+\n+void antenna_at86rf215(void) {\nGPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0);\n+ GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ);\n}\n/**\n@@ -99,10 +111,10 @@ void board_sleep(void) {\n* The timer is divided by 32, whichs gives a 1 microsecond ticks\n*/\nvoid board_timer_init(void) {\n- // Configure the timer\n+ /* Configure the timer */\nTimerConfigure(GPTIMER2_BASE, GPTIMER_CFG_PERIODIC_UP);\n- // Enable the timer\n+ /* Enable the timer */\nTimerEnable(GPTIMER2_BASE, GPTIMER_BOTH);\n}\n@@ -113,6 +125,7 @@ void board_timer_init(void) {\nuint32_t board_timer_get(void) {\nuint32_t current;\n+ /* Get the current timer value */\ncurrent = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5;\nreturn current;\n@@ -126,10 +139,13 @@ bool board_timer_expired(uint32_t future) {\nuint32_t current;\nint32_t remaining;\n+ /* Get current time */\ncurrent = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5;\n+ /* Calculate remaining time */\nremaining = (int32_t) (future - current);\n+ /* Return if timer has expired */\nif (remaining > 0) {\nreturn false;\n} else {\n@@ -147,8 +163,7 @@ void board_reset(void) {\n//=========================== private =========================================\nstatic void gpio_init(void) {\n-\n- // all to input\n+ /* Configure all GPIO as input */\nGPIOPinTypeGPIOInput(GPIO_A_BASE, 0xFF);\nGPIOPinTypeGPIOInput(GPIO_B_BASE, 0xFF);\nGPIOPinTypeGPIOInput(GPIO_C_BASE, 0xFF);\n@@ -171,9 +186,9 @@ static void clock_init(void) {\n/* Set the system clock to 32 MHz */\nSysCtrlClockSet(true, false, SYS_CTRL_SYSDIV_32MHZ);\n- /* Set the IO clock to operate at 16 MHz */\n+ /* Set the IO clock to operate at 32 MHz */\n/* This way peripherals can run while the system clock is gated */\n- SysCtrlIOClockSet(SYS_CTRL_SYSDIV_16MHZ);\n+ SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ);\n/* Wait until the selected clock configuration is stable */\nwhile (!((HWREG(SYS_CTRL_CLOCK_STA)) & (SYS_CTRL_CLOCK_STA_XOSC_STB)));\n@@ -194,22 +209,13 @@ static void clock_init(void) {\n* Configures the user button as input source\n*/\nstatic void button_init(void) {\n- volatile uint32_t i;\n-\n- /* Delay to avoid pin floating problems */\n- for (i = 0xFFFF; i != 0; i--);\n-\n- GPIOPinIntDisable(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n- GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n-\n/* The button is an input GPIO on falling edge */\nGPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_BUTTON_USER);\nGPIOIntTypeSet(BSP_BUTTON_BASE, BSP_BUTTON_USER, GPIO_FALLING_EDGE);\n+ /* Enable wake-up capability */\nGPIOIntWakeupEnable(GPIO_IWE_PORT_D);\n- GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n-\n/* Clear and enable the interrupt */\nGPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER);\nGPIOPinIntEnable(BSP_BUTTON_BASE, BSP_BUTTON_USER);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/board_info.h",
"new_path": "bsp/boards/openmote-b-/board_info.h",
"diff": "#define PORT_PIN_RADIO_RESET_HIGH() // nothing\n#define PORT_PIN_RADIO_RESET_LOW() // nothing\n-#define SLOTDURATION 10 // in miliseconds\n+#define SLOTDURATION 15 // in miliseconds\n//===== IEEE802154E timing\n#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n// execution speed related\n#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n- #define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n+ #define PORT_maxRxAckPrepare 30 // 305us (measured 83us)\n#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n- #define PORT_maxTxAckPrepare 22 // 305us (measured 219us)\n+ #define PORT_maxTxAckPrepare 32 // 305us (measured 219us)\n// radio speed related\n#define PORT_delayTx 12 // 214us (measured 219us)\n#define PORT_delayRx 0 // 0us (can not measure)\n#define NUMSENSORS 7\n+//====== Antenna options ====\n+#define BSP_ANTENNA_BASE GPIO_D_BASE\n+#define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz\n+#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz\n+//#define DAGROOT\n+\n//=========================== typedef ========================================\n//=========================== variables =======================================\n@@ -113,7 +119,7 @@ static const uint8_t infoRadioName[] = \"CC2538 SoC\";\n//=========================== prototypes ======================================\n//=========================== public ==========================================\n-\n+void eraseFlash(void);\n//=========================== private =========================================\n#endif\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. update board configuration.
|
491,595 |
15.09.2018 18:02:06
| -7,200 |
84c473898174f67a39397e9a28591d1a17097d8c
|
support using scons to upload firmware to testbed.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -675,6 +675,58 @@ def OpenMoteCC2538_bootload(target, source, env):\nfor t in bootloadThreads:\ncountingSem.acquire()\n+\n+class opentestbed_bootloadThread(threading.Thread):\n+ def __init__(self,mote,hexFile,countingSem):\n+\n+ # store params\n+ self.mote = mote\n+ self.hexFile = hexFile\n+ self.countingSem = countingSem\n+\n+ # initialize parent class\n+ threading.Thread.__init__(self)\n+ self.name = 'OpenMoteCC2538_bootloadThread_{0}'.format(self.mote)\n+\n+ def run(self):\n+ print 'starting bootloading on {0}'.format(self.mote)\n+ if self.mote == 'testbed':\n+ target = 'all'\n+ else:\n+ target = self.mote\n+ subprocess.call(\n+ 'python '+os.path.join('bootloader','openmote-cc2538','ot_program.py')+' -a {0} {1}'.format(target,self.hexFile),\n+ shell=True\n+ )\n+ print 'done bootloading on {0}'.format(self.mote)\n+\n+ # indicate done\n+ self.countingSem.release()\n+\n+def opentestbed_bootload(target, source, env):\n+ bootloadThreads = []\n+ countingSem = threading.Semaphore(0)\n+\n+ # Enumerate ports\n+ motes = env['bootload'].split(',')\n+\n+ # create threads\n+ for mote in motes:\n+ bootloadThreads += [\n+ opentestbed_bootloadThread(\n+ mote = mote,\n+ hexFile = source[0].path.split('.')[0]+'.ihex',\n+ countingSem = countingSem,\n+ )\n+ ]\n+ # start threads\n+ for t in bootloadThreads:\n+ t.start()\n+ # wait for threads to finish\n+ for t in bootloadThreads:\n+ countingSem.acquire()\n+\n+\nclass openmotestm_bootloadThread(threading.Thread):\ndef __init__(self,comPort,binaryFile,countingSem):\n@@ -818,6 +870,13 @@ def BootloadFunc():\nsrc_suffix = '.ihex',\n)\nelif env['board'] in ['openmote-cc2538','openmote-b','openmote-b-'] :\n+ if 'testbed' in env['bootload'] or len(env['bootload'].split(',')[0].split('-'))==8:\n+ return Builder(\n+ action = opentestbed_bootload,\n+ suffix = '.phonyupload',\n+ src_suffix = '.ihex',\n+ )\n+ else:\nreturn Builder(\naction = OpenMoteCC2538_bootload,\nsuffix = '.phonyupload',\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bootloader/openmote-cc2538/ot_program.py",
"diff": "+import paho.mqtt.client as mqtt\n+import json\n+import base64\n+import time\n+import sys, getopt\n+import Queue\n+import random\n+\n+#============================ defines =========================================\n+BROKER_ADDRESS = \"argus.paris.inria.fr\"\n+NUMBER_OF_MOTES = 80\n+\n+#============================ classes =========================================\n+class program_over_testbed(object):\n+\n+ CLIENT_ID = \"OpenWSN\"\n+ CMD = 'program'\n+\n+ # in seconds, should be larger than the time starting from publishing message until receiving the response\n+ MESSAGE_RESP_TIMEOUT = 30\n+\n+ def __init__(self, mote, image_path):\n+\n+ # initialize parameters\n+ self.mote = mote\n+ self.image = None\n+ self.image_name = ''\n+ with open(image_path,'rb') as f:\n+ self.image = base64.b64encode(f.read())\n+ self.image_name = image_path.split('/')[-1]\n+\n+ # initialize statistic result\n+ self.response_success = {\n+ 'success_counter': 0 ,\n+ 'message_counter': 0 ,\n+ 'failed_messages_topic': []\n+ }\n+\n+ # mqtt topic string format\n+ self.mqtttopic_mote_cmd = 'opentestbed/deviceType/mote/deviceId/{0}/cmd/{1}'.format(self.mote,self.CMD)\n+ self.mqtttopic_mote_resp = 'opentestbed/deviceType/mote/deviceId/{0}/resp/{1}'.format(self.mote,self.CMD)\n+\n+ # connect to MQTT\n+ self.mqttclient = mqtt.Client(self.CLIENT_ID)\n+ self.mqttclient.on_connect = self._on_mqtt_connect\n+ self.mqttclient.on_message = self._on_mqtt_message\n+ self.mqttclient.connect(BROKER_ADDRESS)\n+ self.mqttclient.loop_start()\n+\n+ # create queue for receiving resp messages\n+ self.cmd_response_success_queue = Queue.Queue()\n+\n+ payload_program_image = {\n+ 'token': 123,\n+ 'description': self.image_name,\n+ 'hex': self.image,\n+ }\n+ # publish the cmd message\n+ self.mqttclient.publish(\n+ topic = self.mqtttopic_mote_cmd,\n+ payload = json.dumps(payload_program_image),\n+ )\n+\n+ try:\n+ # wait maxmium MESSAGE_RESP_TIMEOUT seconds before return\n+ self.cmd_response_success_queue.get(timeout=self.MESSAGE_RESP_TIMEOUT)\n+ except Queue.Empty as error:\n+ print \"Getting Response messages timeout in {0} seconds\".format(self.MESSAGE_RESP_TIMEOUT)\n+ finally:\n+ self.is_response_success()\n+ self.mqttclient.loop_stop()\n+\n+ #======================== private =========================================\n+ def _on_mqtt_connect(self, client, userdata, flags, rc):\n+\n+ # subscribe to box commands\n+ if self.mote == 'all':\n+ topic = 'opentestbed/deviceType/mote/deviceId/{0}/resp/{1}'.format('+',self.CMD)\n+ else:\n+ topic = self.mqtttopic_mote_resp\n+\n+ client.subscribe(topic)\n+ # print \"subscribe at {0}\".format(topic)\n+\n+ client.loop_start()\n+\n+ def _on_mqtt_message(self, client, userdata, message):\n+ '''\n+ Record the number of message received and success status\n+ '''\n+\n+ self.response_success['message_counter'] += 1\n+ if json.loads(message.payload)['success']:\n+ self.response_success['success_counter'] += 1\n+ else:\n+ self.response_success['failed_messages_topic'].append(message.topic)\n+\n+ if self.mote == 'all':\n+ if self.response_success['message_counter'] == NUMBER_OF_MOTES:\n+ self.cmd_response_success_queue.put('unblock')\n+ else:\n+ self.cmd_response_success_queue.put('unblock')\n+\n+ #======================== public ==========================================\n+ def is_response_success(self):\n+ print \"--------------------------------------------------------------\"\n+ print \"messges repsonded by {0} motes, {1} motes report with success\".format(\n+ self.response_success['message_counter'],\n+ self.response_success['success_counter']\n+ )\n+ if self.response_success['message_counter'] > self.response_success['success_counter']:\n+ print \"failed_messages_topic :\"\n+ for topic in self.response_success['failed_messages_topic']:\n+ print \" {0}\".format(topic)\n+ print \"--------------------------------------------------------------\"\n+\n+#============================ helper ==========================================\n+def usage():\n+ print(\"\"\"Usage: %s [-h] [-b board] [-a mote eui64 address] [file.ihex]\n+ -h, --help This help\n+ -b board Board name (right now only support openmote-b)\n+ -a mote address Mote address in eui64 format(00-12-4b-00-14-b5-b4-98) or use \"all\" indicating all motes\n+\n+ Examples:\n+ .python opentestbed_reprogram.py -b openmote-b -a 00-12-4b-00-14-b5-b4-98 example/main.ihex\n+ .python opentestbed_reprogram.py -b openmote-b -a all example/main.ihex\n+ \"\"\")\n+\n+\n+#============================ main ============================================\n+if __name__ == \"__main__\":\n+\n+ configure = {}\n+\n+ #==== get the options\n+ try:\n+ opts, args = getopt.getopt(sys.argv[1:], \"hb:a:\", ['help', 'board=', 'mote_address='])\n+ except getopt.GetoptError as err:\n+ print(str(err))\n+ usage()\n+ sys.exit(2)\n+\n+ for opt, arg in opts:\n+ if opt == '-h' or opt == '--help':\n+ usage()\n+ sys.exit(0)\n+ elif opt == '-b' or opt == '--board':\n+ configure['board'] = arg\n+ elif opt == '-a' or opt == '--mote_address':\n+ configure['mote_address'] = str(arg)\n+ else:\n+ assert False, \"Unhandled option\"\n+\n+ try:\n+ configure['image_name_path'] = args[0]\n+ except:\n+ raise Exception('No file path given.')\n+\n+ #==== program_over_testbed\n+ program_over_testbed(configure['mote_address'], configure['image_name_path'])\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. support using scons to upload firmware to testbed.
|
491,595 |
19.09.2018 21:34:53
| -7,200 |
ce7a3d0653ab735b6503f6c3e129940fc09ca760
|
comment out CCA configuration code to reduce binary image size.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/startup_gcc.c",
"new_path": "bsp/boards/openmote-b-/startup_gcc.c",
"diff": "@@ -79,21 +79,32 @@ static uint32_t pui32Stack[512];\n// Reserved (byte 2006 - 2004)\n//\n//*****************************************************************************\n-typedef struct\n-{\n- uint32_t ui32BootldrCfg;\n- uint32_t ui32ImageValid;\n- uint32_t ui32ImageVectorAddr;\n-}\n-lockPageCCA_t;\n-__attribute__ ((section(\".flashcca\"), used))\n-const lockPageCCA_t __cca =\n-{\n- BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled\n- 0, // Image valid bytes\n- FLASH_START_ADDR // Vector table located at flash start address\n-};\n+// NOTE: we do NOT configure the flash CCA part since this will result large binary file to program.\n+// The reason is that the binary output format has no support for holes so every address in the range must be given a value.\n+// (ref: https://www.iar.com/support/tech-notes/linker/huge-binary-file/)\n+\n+// Without CCA configuration, you need make sure it's pre-configured in the flash of the mote.\n+// In case not, you can uncomment the following CCA configuration code and program your mote and next time\n+// you can comment out the following code to reduce the image size.\n+\n+// =================== CCA configuration ======================================\n+// typedef struct\n+// {\n+ // uint32_t ui32BootldrCfg;\n+ // uint32_t ui32ImageValid;\n+ // uint32_t ui32ImageVectorAddr;\n+// }\n+// lockPageCCA_t;\n+\n+// __attribute__ ((section(\".flashcca\"), used))\n+// const lockPageCCA_t __cca =\n+// {\n+ // BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled\n+ // 0, // Image valid bytes\n+ // FLASH_START_ADDR // Vector table located at flash start address\n+// };\n+// =================== End ====================================================\n__attribute__ ((section(\".vectors\"), used))\nvoid (* const gVectors[])(void) =\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-/startup_iar.c",
"new_path": "bsp/boards/openmote-b-/startup_iar.c",
"diff": "@@ -181,20 +181,33 @@ extern void uDMAErrIntHandler(void);\n// Image Valid bytes (bytes 2008 -2011)\n//\n//*****************************************************************************\n-typedef struct\n-{\n- uint32_t ui32BootldrCfg;\n- uint32_t ui32ImageValid;\n- uint32_t ui32ImageVectorAddr;\n-}\n-lockPageCCA_t;\n-__root const lockPageCCA_t __cca @ \".flashcca\" =\n-{\n- BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled\n- 0, // Image valid bytes\n- FLASH_START_ADDR // Vector table located at flash start address\n-};\n+// NOTE: we do NOT configure the flash CCA part since this will result large binary file to program.\n+// The reason is that the binary output format has no support for holes so every address in the range must be given a value.\n+// (ref: https://www.iar.com/support/tech-notes/linker/huge-binary-file/)\n+\n+// Without CCA configuration, you need make sure it's pre-configured in the flash of the mote.\n+// In case not, you can uncomment the following CCA configuration code and program your mote and next time\n+// you can comment out the following code to reduce the image size.\n+\n+// =================== CCA configuration ======================================\n+\n+// typedef struct\n+// {\n+ // uint32_t ui32BootldrCfg;\n+ // uint32_t ui32ImageValid;\n+ // uint32_t ui32ImageVectorAddr;\n+// }\n+// lockPageCCA_t;\n+\n+// __root const lockPageCCA_t __cca @ \".flashcca\" =\n+// {\n+ // BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled\n+ // 0, // Image valid bytes\n+ // FLASH_START_ADDR // Vector table located at flash start address\n+// };\n+\n+// =================== End ====================================================\n//*****************************************************************************\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. comment out CCA configuration code to reduce binary image size.
|
491,595 |
19.09.2018 21:36:06
| -7,200 |
09fcd618187908f8ff23080999030455ff176eef
|
do NOT erase the last page to avoid to change the CCA configuration.
|
[
{
"change_type": "MODIFY",
"old_path": "bootloader/openmote-cc2538/cc2538-bsl.py",
"new_path": "bootloader/openmote-cc2538/cc2538-bsl.py",
"diff": "@@ -236,7 +236,7 @@ class CommandInterface(object):\n# it has actually entered its bootloader mode.\n#\n- time.sleep(0.002)\n+ time.sleep(0.1)\ndef close(self):\nself.sp.close()\n@@ -710,8 +710,11 @@ class CC2538(Chip):\nmdebug(5, \"Primary IEEE Address: %s\" % (':'.join('%02X' % x for x in ieee_addr)))\ndef erase(self):\n- mdebug(5, \"Erasing %s bytes starting at address 0x%08X\" % (self.size, self.flash_start_addr))\n- return self.command_interface.cmdEraseMemory(self.flash_start_addr, self.size)\n+ # do not erase the last page, which including the CCA configuration\n+ # the minimal size to erase is one page size(check the erase command: http://www.ti.com/lit/ug/swru333a/swru333a.pdf )\n+ one_page_size = 2048\n+ mdebug(5, \"Erasing %s bytes starting at address 0x%08X\" % (self.size-one_page_size, self.flash_start_addr))\n+ return self.command_interface.cmdEraseMemory(self.flash_start_addr, self.size-one_page_size)\ndef read_memory(self, addr):\n# CC2538's COMMAND_MEMORY_READ sends each 4-byte number in inverted\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. do NOT erase the last page to avoid to change the CCA configuration.
|
491,595 |
19.09.2018 21:38:34
| -7,200 |
21c83d317e79890d544397cf943d1d2d41e3823d
|
use binary file rather then hex file.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -211,7 +211,7 @@ elif env['toolchain']=='armgcc':\n# compiler (C)\nenv.Replace(CC = 'arm-none-eabi-gcc')\n- env.Append(CCFLAGS = '-O0')\n+ env.Append(CCFLAGS = '-Os')\nenv.Append(CCFLAGS = '-Wall')\nenv.Append(CCFLAGS = '-Wa,-adhlns=${TARGET.base}.lst')\nenv.Append(CCFLAGS = '-c')\n@@ -626,11 +626,11 @@ def telosb_bootload(target, source, env):\ncountingSem.acquire()\nclass OpenMoteCC2538_bootloadThread(threading.Thread):\n- def __init__(self,comPort,hexFile,countingSem):\n+ def __init__(self,comPort,binFile,countingSem):\n# store params\nself.comPort = comPort\n- self.hexFile = hexFile\n+ self.binFile = binFile\nself.countingSem = countingSem\n# initialize parent class\n@@ -640,7 +640,7 @@ class OpenMoteCC2538_bootloadThread(threading.Thread):\ndef run(self):\nprint 'starting bootloading on {0}'.format(self.comPort)\nsubprocess.call(\n- 'python '+os.path.join('bootloader','openmote-cc2538','cc2538-bsl.py')+' -e --bootloader-invert-lines -w -b 400000 -p {0} {1}'.format(self.comPort,self.hexFile),\n+ 'python '+os.path.join('bootloader','openmote-cc2538','cc2538-bsl.py')+' -e --bootloader-invert-lines -w -b 400000 -p {0} {1}'.format(self.comPort,self.binFile),\nshell=True\n)\nprint 'done bootloading on {0}'.format(self.comPort)\n@@ -663,8 +663,7 @@ def OpenMoteCC2538_bootload(target, source, env):\nbootloadThreads += [\nOpenMoteCC2538_bootloadThread(\ncomPort = comPort,\n- #hexFile = os.path.split(source[0].path)[1].split('.')[0]+'.bin',\n- hexFile = source[0].path.split('.')[0]+'.ihex',\n+ binFile = source[0].path.split('.')[0]+'.bin',\ncountingSem = countingSem,\n)\n]\n@@ -677,11 +676,11 @@ def OpenMoteCC2538_bootload(target, source, env):\nclass opentestbed_bootloadThread(threading.Thread):\n- def __init__(self,mote,hexFile,countingSem):\n+ def __init__(self,mote,binFile,countingSem):\n# store params\nself.mote = mote\n- self.hexFile = hexFile\n+ self.binFile = binFile\nself.countingSem = countingSem\n# initialize parent class\n@@ -695,7 +694,7 @@ class opentestbed_bootloadThread(threading.Thread):\nelse:\ntarget = self.mote\nsubprocess.call(\n- 'python '+os.path.join('bootloader','openmote-cc2538','ot_program.py')+' -a {0} {1}'.format(target,self.hexFile),\n+ 'python '+os.path.join('bootloader','openmote-cc2538','ot_program.py')+' -a {0} {1}'.format(target,self.binFile),\nshell=True\n)\nprint 'done bootloading on {0}'.format(self.mote)\n@@ -715,7 +714,7 @@ def opentestbed_bootload(target, source, env):\nbootloadThreads += [\nopentestbed_bootloadThread(\nmote = mote,\n- hexFile = source[0].path.split('.')[0]+'.ihex',\n+ binFile = source[0].path.split('.')[0]+'.bin',\ncountingSem = countingSem,\n)\n]\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. use binary file rather then hex file.
|
491,605 |
20.09.2018 11:36:07
| -7,200 |
f9def26945177e9399fc74be692a57872a76616b
|
Added ADC sensor for battery monitoring.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/SConscript",
"new_path": "bsp/boards/SConscript",
"diff": "@@ -14,6 +14,7 @@ sources_h = [\n'radio.h',\n'uart.h',\n'sctimer.h',\n+ 'sensors.h',\nos.path.join('common', 'openccms.h'),\nos.path.join('common', 'openaes.h'),\n]\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/sensors.h",
"new_path": "bsp/boards/sensors.h",
"diff": "#ifndef __SENSORS_H__\n#define __SENSORS_H__\n+#include \"stdint.h\"\n+#include \"board.h\"\n+\n//=========================== define ==========================================\n/// define NUMSENSORS if not defined in board_info.h\n@@ -24,6 +27,7 @@ enum {\nSENSOR_ZACCELERATION,\nSENSOR_ADCTEMPERATURE,\nSENSOR_DEFAULT,\n+ SENSOR_ADCBATTERY,\nSENSOR_LAST // new sensor types go before this one\n};\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added ADC sensor for battery monitoring.
|
491,605 |
20.09.2018 11:36:22
| -7,200 |
15498b2797cb4a5a5933648a0a2c931d3e686460
|
Updated for nRF52840 Dongle.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -197,7 +197,7 @@ elif env['toolchain']=='iar-proj':\nelif env['toolchain']=='armgcc':\n- if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm','samr21_xpro','nrf52840dk']:\n+ if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm','samr21_xpro','nrf52840']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\nif env['board'] in ['openmote-cc2538','openmote-b']:\n@@ -391,22 +391,7 @@ elif env['toolchain']=='armgcc':\nenv.Replace(NM = 'arm-none-eabi-nm')\nenv.Replace(SIZE = 'arm-none-eabi-size')\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n- elif env['board']=='nrf52840dk':\n+ elif env['board']=='nrf52840':\n# @note: a few changes have been made to the sdk config file[s], these need to be removed and the corresponding defines be made here!\n@@ -425,11 +410,20 @@ elif env['toolchain']=='armgcc':\nenv.Append(CCFLAGS = '-ffunction-sections')\nenv.Append(CCFLAGS = '-fdata-sections')\nenv.Append(CCFLAGS = '-mfpu=fpv4-sp-d16')\n- env.Append(CCFLAGS = '-mfloat-abi=softfp')\n+ env.Append(CCFLAGS = '-mfloat-abi=hard')\nenv.Append(CCFLAGS = '-D__FPU_PRESENT=1')\nenv.Append(CCFLAGS = '-DUSE_APP_CONFIG=1')\nenv.Append(CCFLAGS = '-DNRF52840_XXAA=1') # set the CPU to nRF52840 (ARM Cortex M4f)\n+ if env['revision'] == \"DK\":\nenv.Append(CCFLAGS = '-DBOARD_PCA10056=1') # set the board to be the nRF52840 Development Kit\n+ print \"*** nrf52840-DK ***\\n\"\n+ elif env['revision'] == \"DONGLE\":\n+ env.Append(CCFLAGS = '-DBOARD_PCA10059=1') # set the board to be the nRF52840 Dongle\n+ env.Append(CCFLAGS = '-DCONFIG_NFCT_PINS_AS_GPIOS=1') # configure NFCT pins as GPIOs\n+ print \"*** nrf52840-DONGLE ***\\n\"\n+ else:\n+ print \"*** unknown ***\\n\"\n+\nenv.Append(CCFLAGS = '-DCONFIG_GPIO_AS_PINRESET=1') # just to be able to reset the board via the on-board reset pin\n# assembler\n@@ -438,19 +432,22 @@ elif env['toolchain']=='armgcc':\nenv.Append(ASFLAGS = '-DNRF52840_XXAA=1')\n# linker\n- env.Append(LINKFLAGS = '-Lbsp/boards/nrf52840dk/sdk/modules/nrfx/mdk')\n+ env.Append(LINKFLAGS = '-Lbsp/boards/nrf52840/sdk/modules/nrfx/mdk')\nenv.Append(LINKFLAGS = '-g -gdwarf-2 -mcpu=cortex-m4 -mthumb')\n# @todo: Decide which linker script to use\n- env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/nrf52840_xxaa.ld')\n- # env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840dk/sdk/config/nrf52840/armgcc/generic_gcc_nrf52.ld')\n+ if env['revision'] == \"DK\":\n+ env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840/nrf52840_xxaa.ld')\n+ elif env['revision'] == \"DONGLE\":\n+ env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840/nrf52840_xxaa_dongle.ld')\n+ # env.Append(LINKFLAGS = '-Tbsp/boards/nrf52840/sdk/config/nrf52840/armgcc/generic_gcc_nrf52.ld')\n# env.Append(LINKFLAGS = '--strip-debug')\nenv.Append(LINKFLAGS = '-Xlinker --gc-sections -Xlinker')\nenv.Append(LINKFLAGS = '-Map=${TARGET.base}.map')\n- env.Append(LINKFLAGS = '-mfpu=fpv4-sp-d16 -mfloat-abi=softfp --specs=nosys.specs')\n+ env.Append(LINKFLAGS = '-mfpu=fpv4-sp-d16 -mfloat-abi=hard --specs=nosys.specs')\n#--specs=nano.specs\nenv.Append(LINKFLAGS = '-Wl,--start-group -lgcc -lc -lg -lm -lnosys -Wl,--end-group')\n@@ -468,22 +465,6 @@ elif env['toolchain']=='armgcc':\nenv.Replace(NM = 'arm-none-eabi-nm')\nenv.Replace(SIZE = 'arm-none-eabi-size')\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\nelse:\nraise SystemError('unexpected board={0}'.format(env['board']))\n@@ -573,12 +554,15 @@ def jtagUploadFunc(location):\nsuffix = '.phonyupload',\nsrc_suffix = '.ihex',\n)\n- if env['board']=='nrf52840dk':\n+ if env['board']=='nrf52840':\n+ if env['revision']=='DK':\nreturn Builder(\naction = os.path.join('bsp','boards',env['board'],'tools','flash.sh') + \" $SOURCE\",\nsuffix = '.phonyupload',\nsrc_suffix = '.elf',\n)\n+ else:\n+ raise SystemError('Only nRF52840 DK flashing is supported at the moment.')\nelse:\nif env['fet_version']==2:\n# MSP-FET430uif is running v2 Firmware\n@@ -863,10 +847,10 @@ def extras(env, source):\nreturnVal = []\nreturnVal += [env.PrintSize(source=source)]\nreturnVal += [env.Elf2iHex(source=source)]\n- if env['board'] != 'nrf52840dk':\n+ if env['board'] != 'nrf52840':\nreturnVal += [env.Elf2iBin(source=source)]\nif env['jtag']:\n- if env['board'] == 'nrf52840dk' and env['jtag'] == 'bflash':\n+ if env['board'] == 'nrf52840' and env['revision'] == 'DK' and env['jtag'] == 'bflash':\nreturnVal += [env.JtagUpload(source)]\nelse:\nreturnVal += [env.JtagUpload(env.Elf2iHex(source))]\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -37,7 +37,7 @@ project:\nboard Board to build for. 'python' is for software simulation.\ntelosb, wsn430v14, wsn430v13b, gina, z1, python,\n- iot-lab_M3, iot-lab_A8-M3, nrf52840dk\n+ iot-lab_M3, iot-lab_A8-M3, nrf52840\nversion Board version\n@@ -115,8 +115,8 @@ command_line_options = {\n'iot-lab_A8-M3',\n'agilefox',\n'samr21_xpro',\n- # Cortex-M4\n- 'nrf52840dk',\n+ # Nordic nRF52840 (Cortex-M4), use revision=DK or revision=DONGLE\n+ 'nrf52840',\n# misc.\n'python',\n],\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Updated for nRF52840 Dongle.
|
491,595 |
20.09.2018 18:24:23
| -7,200 |
91cc2ba8f70e3bf71a4804178a782a1d463a3dfd
|
set number_of_motes to 76.
|
[
{
"change_type": "MODIFY",
"old_path": "bootloader/openmote-cc2538/ot_program.py",
"new_path": "bootloader/openmote-cc2538/ot_program.py",
"diff": "@@ -8,7 +8,7 @@ import random\n#============================ defines =========================================\nBROKER_ADDRESS = \"argus.paris.inria.fr\"\n-NUMBER_OF_MOTES = 80\n+NUMBER_OF_MOTES = 80 - 4 # 4 motes are used for local test\n#============================ classes =========================================\nclass program_over_testbed(object):\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. set number_of_motes to 76.
|
491,595 |
20.09.2018 20:47:50
| -7,200 |
711c2b9626d5bc5177ca3c6b6ea1d4504a6a5b68
|
update scons files.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -169,7 +169,7 @@ elif env['toolchain']=='iar':\nelif env['toolchain']=='iar-proj':\n- if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','openmote-b','openmote-b-','iot-lab_M3']:\n+ if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','openmote-b','openmote-b-24ghz','iot-lab_M3']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\nenv['IAR_EW430_INSTALLDIR'] = os.environ['IAR_EW430_INSTALLDIR']\n@@ -199,10 +199,10 @@ elif env['toolchain']=='iar-proj':\nelif env['toolchain']=='armgcc':\n- if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','openmote-b-','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro', 'scum']:\n+ if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','openmote-b-24ghz','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro', 'scum']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\n- if env['board'] in ['openmote-cc2538','openmote-b','openmote-b-']:\n+ if env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz']:\nif env['revision'] == \"A1\":\nlinker_file = 'cc2538sf23.lds'\nprint \"*** OPENMOTE CC2538 REV. A1 ***\\n\"\n@@ -869,7 +869,7 @@ def BootloadFunc():\nsuffix = '.phonyupload',\nsrc_suffix = '.ihex',\n)\n- elif env['board'] in ['openmote-cc2538','openmote-b','openmote-b-'] :\n+ elif env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz'] :\nif 'testbed' in env['bootload'] or len(env['bootload'].split(',')[0].split('-'))==8:\nreturn Builder(\naction = opentestbed_bootload,\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -111,7 +111,7 @@ command_line_options = {\n# Cortex-M3\n'openmote-cc2538',\n'openmote-b',\n- 'openmote-b-',\n+ 'openmote-b-24ghz',\n'silabs-ezr32wg',\n'openmotestm',\n'iot-lab_M3',\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/SConscript",
"new_path": "bsp/boards/openmote-b-24ghz/SConscript",
"diff": "@@ -16,9 +16,9 @@ source = \\\nlocalEnv.Append(\nCPPPATH = [\n- os.path.join('#','bsp','boards','openmote-b-'),\n- os.path.join('#','bsp','boards','openmote-b-','headers'),\n- os.path.join('#','bsp','boards','openmote-b-','source'),\n+ os.path.join('#','bsp','boards','openmote-b-24ghz'),\n+ os.path.join('#','bsp','boards','openmote-b-24ghz','headers'),\n+ os.path.join('#','bsp','boards','openmote-b-24ghz','source'),\nos.path.join('#','bsp','chips','si70x'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"new_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"diff": "//=========================== variables =======================================\nstatic const uint8_t rreg_uriquery[] = \"h=ucb\";\n-static const uint8_t infoBoardname[] = \"CC2538\";\n+static const uint8_t infoBoardname[] = \"openmote-b-24ghz\";\nstatic const uint8_t infouCName[] = \"CC2538\";\nstatic const uint8_t infoRadioName[] = \"CC2538 SoC\";\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. update scons files.
|
491,595 |
20.09.2018 20:50:02
| -7,200 |
c39a871be87969d7c6165b5a12a015940d29d0ac
|
update text printed out.
|
[
{
"change_type": "MODIFY",
"old_path": "bootloader/openmote-cc2538/ot_program.py",
"new_path": "bootloader/openmote-cc2538/ot_program.py",
"diff": "@@ -104,7 +104,7 @@ class program_over_testbed(object):\n#======================== public ==========================================\ndef is_response_success(self):\nprint \"--------------------------------------------------------------\"\n- print \"messges repsonded by {0} motes, {1} motes report with success\".format(\n+ print \"Try to program {0} motes, {1} motes report with success\".format(\nself.response_success['message_counter'],\nself.response_success['success_counter']\n)\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. update text printed out.
|
491,595 |
20.09.2018 20:53:40
| -7,200 |
6c36078368c132e561acff4c5e8238dca08822d5
|
add openmote-b-24ghz to travis
|
[
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -29,6 +29,7 @@ script:\n- scons board=openmote-cc2538 goldenImage=sniffer toolchain=armgcc verbose=1 oos_sniffer\n- scons board=openmote-cc2538 goldenImage=root toolchain=armgcc verbose=1 oos_openwsn\n- scons board=openmote-b toolchain=armgcc verbose=1 oos_openwsn\n+- scons board=openmote-b-24ghz toolchain=armgcc verbose=1 oos_openwsn\n# - scons board=wsn430v14 toolchain=mspgcc verbose=1 oos_openwsn\n# - scons board=wsn430v13b toolchain=mspgcc verbose=1 oos_openwsn\n# - scons board=gina toolchain=mspgcc verbose=1 oos_openwsn\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. add openmote-b-24ghz to travis
|
491,605 |
21.09.2018 13:20:43
| -7,200 |
2198204e56254747212150a3f4c1b7b403b19d4e
|
Updated flash.sh for flashing nRF52840 Development Kit.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840/tools/flash.sh",
"new_path": "bsp/boards/nrf52840/tools/flash.sh",
"diff": "#!/bin/bash\n-FILE=$(echo $1 | sed \"s/.*\\/.*\\/.*\\/.*\\/\\([0-9]\\+\\)/\\1/\")\n-DIR=$(dirname $1)\n-#echo -e \"Direktirij $DIR\"\n-echo -e \"\\n\\t FLASHING $FILE to nrf52840dk (needs nrfjprog tools in nrf52840/tools/nrfjprog folder)\\n\"\n+if [ -d \"./bsp/boards/nrf52840/tools/nrfjprog\" ]; then\n-cd $DIR\n-arm-none-eabi-objcopy -O ihex $FILE out.ihex\n-./../../../../bsp/boards/nrf52840/tools/nrfjprog/nrfjprog -f nrf52 --program out.ihex --sectorerase\n-./../../../../bsp/boards/nrf52840/tools/nrfjprog/nrfjprog -f nrf52 --reset\n+ echo -e \"\\n\\t FLASHING $1 to nrf52840dk\\n\"\n-cd ../../../..\n+ ./bsp/boards/nrf52840/tools/nrfjprog/nrfjprog -f nrf52 --program $1 --sectorerase\n+ ./bsp/boards/nrf52840/tools/nrfjprog/nrfjprog -f nrf52 --reset\n+\n+else\n+\n+ echo -e \"\\n\\n[WARNING]\\n\"\n+ echo -e \"To be able to flash the Nordic nRF52840 Development Kit you will need to install\"\n+ echo -e \"both the latest JLink Software (https://www.segger.com/downloads/jlink/) and\"\n+ echo -e \"nRF5x-Command-Line-Tools (https://www.nordicsemi.com/eng/Products/nRF52840#Downloads)\"\n+ echo -e \"into the directory './bsp/boards/nrf52840/tools/nrfjprog'.\\n\"\n+\n+fi\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Updated flash.sh for flashing nRF52840 Development Kit.
|
491,595 |
24.09.2018 19:43:50
| -7,200 |
81fddc4d7c1fa0add1a584875c4192f96c6471bb
|
correct the version .
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n-#define OPENWSN_VERSION_MINOR 11\n+#define OPENWSN_VERSION_MINOR 17\n#define OPENWSN_VERSION_PATCH 0\n#ifndef TRUE\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. correct the version .
|
491,595 |
25.09.2018 10:40:57
| -7,200 |
01bb5b299a437b5be436efb65a464e48499c9436
|
openmote-b-subghz scons support.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -169,7 +169,7 @@ elif env['toolchain']=='iar':\nelif env['toolchain']=='iar-proj':\n- if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','openmote-b','openmote-b-24ghz','iot-lab_M3']:\n+ if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','openmote-b','openmote-b-24ghz','openmote-b-subghz','iot-lab_M3']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\nenv['IAR_EW430_INSTALLDIR'] = os.environ['IAR_EW430_INSTALLDIR']\n@@ -199,10 +199,10 @@ elif env['toolchain']=='iar-proj':\nelif env['toolchain']=='armgcc':\n- if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','openmote-b-24ghz','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro', 'scum']:\n+ if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','openmote-b-24ghz','openmote-b-subghz','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro', 'scum']:\nraise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))\n- if env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz']:\n+ if env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz', 'openmote-b-subghz']:\nif env['revision'] == \"A1\":\nlinker_file = 'cc2538sf23.lds'\nprint \"*** OPENMOTE CC2538 REV. A1 ***\\n\"\n@@ -869,7 +869,7 @@ def BootloadFunc():\nsuffix = '.phonyupload',\nsrc_suffix = '.ihex',\n)\n- elif env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz'] :\n+ elif env['board'] in ['openmote-cc2538','openmote-b','openmote-b-24ghz', 'openmote-b-subghz'] :\nif 'testbed' in env['bootload'] or len(env['bootload'].split(',')[0].split('-'))==8:\nreturn Builder(\naction = opentestbed_bootload,\n"
},
{
"change_type": "MODIFY",
"old_path": "SConstruct",
"new_path": "SConstruct",
"diff": "@@ -112,6 +112,7 @@ command_line_options = {\n'openmote-cc2538',\n'openmote-b',\n'openmote-b-24ghz',\n+ 'openmote-b-subghz',\n'silabs-ezr32wg',\n'openmotestm',\n'iot-lab_M3',\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/SConscript",
"new_path": "bsp/boards/openmote-b-subghz/SConscript",
"diff": "@@ -16,9 +16,9 @@ source = \\\nlocalEnv.Append(\nCPPPATH = [\n- os.path.join('#','bsp','boards','openmote-b-24ghz'),\n- os.path.join('#','bsp','boards','openmote-b-24ghz','headers'),\n- os.path.join('#','bsp','boards','openmote-b-24ghz','source'),\n+ os.path.join('#','bsp','boards','openmote-b-subghz'),\n+ os.path.join('#','bsp','boards','openmote-b-subghz','headers'),\n+ os.path.join('#','bsp','boards','openmote-b-subghz','source'),\nos.path.join('#','bsp','chips','si70x'),\n],\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board_info.h",
"new_path": "bsp/boards/openmote-b-subghz/board_info.h",
"diff": "//=========================== variables =======================================\nstatic const uint8_t rreg_uriquery[] = \"h=ucb\";\n-static const uint8_t infoBoardname[] = \"openmote-b-24ghz\";\n+static const uint8_t infoBoardname[] = \"openmote-b-subghz\";\nstatic const uint8_t infouCName[] = \"CC2538\";\nstatic const uint8_t infoRadioName[] = \"CC2538 SoC\";\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/03oos_sniffer/03oos_sniffer.ewp",
"new_path": "projects/openmote-b-subghz/03oos_sniffer/03oos_sniffer.ewp",
"diff": "</option>\n<option>\n<name>Input description</name>\n- <state>Automatic choice of formatter.</state>\n+ <state>Automatic choice of formatter, without multibyte support.</state>\n</option>\n<option>\n<name>Output description</name>\n- <state>Automatic choice of formatter.</state>\n+ <state>Automatic choice of formatter, without multibyte support.</state>\n</option>\n<option>\n<name>GOutputBinary</name>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\max44009\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\sht21\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\si70x\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\kernel\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\drivers\\common\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\inc\\</state>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\sht21\\sht21.h</name>\n</file>\n</group>\n+ <group>\n+ <name>si70x</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\si70x\\si70x.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\si70x\\si70x.h</name>\n+ </file>\n+ </group>\n</group>\n</group>\n<group>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. openmote-b-subghz scons support.
|
491,595 |
25.09.2018 11:41:08
| -7,200 |
7de2f8121bfc306d38fe6ff22703ea17159bd89b
|
update radio driver.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.c",
"new_path": "bsp/chips/at86rf215/at86rf215.c",
"diff": "\\brief AT86RF215-specific library.\n\\author Jonathan Munoz <jonathan.munoz@inria.fr>, August 2016.\n+\\author Xavi Vilajosana <xvilajosana@eecs.berkeley.edu>, December 2017.\n+\n*/\n#include \"board.h\"\n-#include \"radio.h\"\n#include \"at86rf215.h\"\n#include \"spi.h\"\n-#include \"radiotimer.h\"\n#include \"debugpins.h\"\n#include \"leds.h\"\n+#include \"radio.h\"\nvoid at86rf215_spiStrobe(uint8_t strobe) {\n@@ -60,7 +61,6 @@ uint8_t at86rf215_spiReadReg(uint16_t regAddr16) {\nspi_tx_buffer[1] = (uint8_t)(regAddr16 & 0xFF);\nspi_tx_buffer[2] = 0x00;\n-\nspi_txrx(\nspi_tx_buffer, // bufTx\nsizeof(spi_tx_buffer), // lenbufTx\n@@ -214,6 +214,8 @@ void at86rf215_read_isr (uint8_t* rf09_isr){\n*(rf09_isr+3) = spi_rx[5];\n}\n+\n+\nvoid at86rf215_readBurst(uint16_t reg, uint8_t* regValueRead, uint16_t size){\nuint8_t spi_tx[2049];\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -4522,7 +4522,7 @@ static const registerSetting_t basic_settings_ofdm_4_mcs6[] = { //TODO\n{RG_BBC0_OFDMPHRTX, 0x06},\n};\n-static const registerSetting_t* modulation_list[] = {\n+/*static const registerSetting_t* modulation_list[] = {\n// {basic_settings_ofdm_1_mcs0},\n// {basic_settings_ofdm_2_mcs0},\n// {basic_settings_ofdm_1_mcs1},\n@@ -4531,20 +4531,20 @@ static const registerSetting_t* modulation_list[] = {\n// {basic_settings_ofdm_1_mcs2},\n// {basic_settings_ofdm_2_mcs2},\n// {basic_settings_ofdm_3_mcs2},\n- {basic_settings_ofdm_4_mcs2},\n+ basic_settings_ofdm_4_mcs2,\n// {basic_settings_ofdm_1_mcs3},\n// {basic_settings_ofdm_2_mcs3},\n// {basic_settings_ofdm_3_mcs3},\n- {basic_settings_ofdm_4_mcs3},\n+ basic_settings_ofdm_4_mcs3,\n// {basic_settings_ofdm_2_mcs4},\n// {basic_settings_ofdm_3_mcs4},\n- {basic_settings_ofdm_4_mcs4},\n+ basic_settings_ofdm_4_mcs4,\n// {basic_settings_ofdm_2_mcs5},\n// {basic_settings_ofdm_3_mcs5},\n- {basic_settings_ofdm_4_mcs5},\n+ basic_settings_ofdm_4_mcs5,\n// {basic_settings_ofdm_3_mcs6},\n- {basic_settings_ofdm_4_mcs6},\n-};\n+ basic_settings_ofdm_4_mcs6,\n+};*/\nstatic const uint16_t sizes[] = {\n6, 127, 1000, 2047,\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "#include \"board.h\"\n#include \"radio.h\"\n-#include \"at86rf215.h\"\n+\n#include \"spi.h\"\n#include \"debugpins.h\"\n#include \"leds.h\"\n+#include \"sctimer.h\"\n+\n+#include <headers/hw_ioc.h>\n+#include <headers/hw_memmap.h>\n+#include <headers/hw_ssi.h>\n+#include <headers/hw_sys_ctrl.h>\n+#include <headers/hw_types.h>\n+\n+#include <source/interrupt.h>\n+#include <source/ioc.h>\n+#include <source/gpio.h>\n+#include <source/sys_ctrl.h>\n+\n+#define AT86RF215_IRQ_BASE ( GPIO_D_BASE )\n+#define AT86RF215_IRQ_PIN ( GPIO_PIN_0 )\n+#define AT86RF215_IRQ_IOC ( IOC_OVERRIDE_DIS )\n+#define AT86RF215_IRQ_EDGE ( GPIO_RISING_EDGE )\n//=========================== defines =========================================\n//=========================== variables =======================================\ntypedef struct {\n- radiotimer_capture_cbt startFrame_cb;\n- radiotimer_capture_cbt endFrame_cb;\n+ radio_capture_cbt startFrame_cb;\n+ radio_capture_cbt endFrame_cb;\nradio_state_t state;\nuint8_t rf09_isr;\nuint8_t rf24_isr;\n@@ -28,11 +45,42 @@ typedef struct {\nradio_vars_t radio_vars;\n//=========================== public ==========================================\n-void radio_read_isr(uint8_t* rf09_isr);\n+\n+static void radio_read_isr(void);\n+static void radio_clear_isr(void);\n+\n//===== admin\n+void radio_powerOn(void) {\n+ volatile uint32_t delay;\n+\n+ GPIOPinTypeGPIOOutput(GPIO_C_BASE, GPIO_PIN_0);\n+ GPIOPinTypeGPIOOutput(GPIO_D_BASE, GPIO_PIN_1);\n+\n+ //set radio pwr off\n+ GPIOPinWrite(GPIO_C_BASE, GPIO_PIN_0, 0);\n+ GPIOPinWrite(GPIO_D_BASE, GPIO_PIN_1, 0);\n+ for(delay=0;delay<0xA2C2;delay++);\n+\n+ //init the radio, pwr up the radio\n+ GPIOPinWrite(GPIO_C_BASE, GPIO_PIN_0, GPIO_PIN_0);\n+ for(delay=0;delay<0xA2C2;delay++);\n+\n+ //reset the radio\n+ GPIOPinWrite(GPIO_D_BASE, GPIO_PIN_1, GPIO_PIN_1);\n+\n+}\n+\n+void radio_reset(void) {\n+ at86rf215_spiWriteReg( RG_RF_RST, CMD_RF_RESET);\n+}\n+\nvoid radio_init(void) {\n+ uint16_t i;\n+ //power it on and configure pins\n+ radio_powerOn();\n+\n// clear variables\nmemset(&radio_vars,0,sizeof(radio_vars_t));\n@@ -41,25 +89,38 @@ void radio_init(void) {\n// reset radio\nradio_reset();\n+\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\nwhile(at86rf215_status() != RF_STATE_TRXOFF);\n+\n// change state\nradio_vars.state = RADIOSTATE_RFOFF;\n- P1SEL &= (~BIT4); // Set P1.4 SEL as GPIO\n- P1DIR &= (~BIT4); // Set P1.4 SEL as Input\n- P1IES &= (~BIT4); // low to high edge\n- P1IFG &= (~BIT4); // Clear interrupt flag for P1.4\n- P1IE |= (BIT4); // Enable interrupt for P1.4\n+ //configure external radio interrupt in pin D0\n+ GPIOPinIntDisable(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN);\n+\n+ /* The gpio is an input GPIO on rising edge */\n+ GPIOPinTypeGPIOInput(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN);\n+\n+ GPIOIntTypeSet(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN, GPIO_RISING_EDGE);\n+\n+ GPIOPinIntClear(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN);\n+ /* Register the interrupt */\n+ GPIOPortIntRegister(AT86RF215_IRQ_BASE, radio_isr);\n+\n+ /* Clear and enable the interrupt */\n+ GPIOPinIntEnable(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN);\n+\n//check part number and version\nif ((at86rf215_spiReadReg(RG_RF_PN) != 0x34) | (at86rf215_spiReadReg(RG_RF_VN) != 0x03)) {\nwhile(1); //UNKNOWN DEVICE, FINISH\n}\n- // Write registers to radio\n- for(uint16_t i = 0; i < (sizeof(basic_settings_fsk_option2)/sizeof(registerSetting_t)); i++) {\n- at86rf215_spiWriteReg( basic_settings_fsk_option2[i].addr, basic_settings_fsk_option2[i].data);\n+ // Write registers to radio -- default configuration OFDM 400kbps\n+ for( i = 0; i < (sizeof(basic_settings_ofdm_1_mcs2)/sizeof(registerSetting_t)); i++) {\n+ at86rf215_spiWriteReg( basic_settings_ofdm_1_mcs2[i].addr, basic_settings_ofdm_1_mcs2[i].data);\n};\n- radio_read_isr(&radio_vars.rf09_isr);\n+\n+ radio_read_isr();\n}\nvoid radio_change_size(uint16_t* size){\n@@ -67,65 +128,34 @@ void radio_change_size(uint16_t* size){\n*size = sizes[i%4];\ni++;\n}\n-void radio_change_modulation(void) {\n+\n+void radio_change_modulation(registerSetting_t * mod){\nstatic int mod_list = 1;\n+ uint16_t i;\n+\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\nwhile(at86rf215_status() != RF_STATE_TRXOFF);\n- for(uint16_t i = 0; i < (sizeof(basic_settings_fsk_option1)/sizeof(registerSetting_t)); i++) {\n- at86rf215_spiWriteReg( modulation_list[mod_list%5][i].addr, modulation_list[mod_list%5][i].data);\n- //at86rf215_spiWriteReg( basic_settings_fsk_option1[i].addr, basic_settings_fsk_option1[i].data);\n+\n+ for( i = 0; i < (sizeof(*mod)/sizeof(registerSetting_t)); i++) {\n+ at86rf215_spiWriteReg( mod[i].addr, mod[i].data);\n};\n- radio_read_isr(&radio_vars.rf09_isr);\n+ radio_read_isr();\nmod_list++;\n}\n-void radio_setOverflowCb(radiotimer_compare_cbt cb) {\n- radiotimer_setOverflowCb(cb);\n-}\n-\n-void radio_setCompareCb(radiotimer_compare_cbt cb) {\n- radiotimer_setCompareCb(cb);\n-}\n-\n-void radio_setStartFrameCb(radiotimer_capture_cbt cb) {\n+void radio_setStartFrameCb(radio_capture_cbt cb) {\nradio_vars.startFrame_cb = cb;\n}\n-void radio_setEndFrameCb(radiotimer_capture_cbt cb) {\n+void radio_setEndFrameCb(radio_capture_cbt cb) {\nradio_vars.endFrame_cb = cb;\n}\n-//===== reset\n-\n-void radio_reset(void) {\n-\n- at86rf215_spiWriteReg( RG_RF_RST, CMD_RF_RESET);\n-}\n-\n-//===== timer\n-\n-void radio_startTimer(uint16_t period) {\n- radiotimer_start(period);\n-}\n-\n-uint16_t radio_getTimerValue(void) {\n- return radiotimer_getValue();\n-}\n-\n-void radio_setTimerPeriod(uint16_t period) {\n- radiotimer_setPeriod(period);\n-}\n-\n-uint16_t radio_getTimerPeriod(void) {\n- return radiotimer_getPeriod();\n-}\n-\n//===== RF admin\n//channel spacing in KHz\n//frequency_0 in kHz\n//frequency_nb integer\nvoid radio_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel) {\n-\nfrequency_0 = (frequency_0/25);\nat86rf215_spiWriteReg(RG_RF09_CS, (uint8_t)(channel_spacing/25));\nat86rf215_spiWriteReg(RG_RF09_CCF0L, (uint8_t)(frequency_0%256));\n@@ -134,15 +164,12 @@ void radio_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t\nat86rf215_spiWriteReg(RG_RF09_CNM, (uint8_t)(channel/256));\n// change state\nradio_vars.state = RADIOSTATE_FREQUENCY_SET;\n-\n}\nvoid radio_rfOn(void) {\n-\n//put the radio in the TRXPREP state\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\n//while(radio_vars.state != RADIOSTATE_TX_ENABLED);\n-\n}\nvoid radio_rfOff(void) {\n@@ -153,7 +180,7 @@ void radio_rfOff(void) {\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\n// wiggle debug pin\ndebugpins_radio_clr();\n- leds_radio_off();\n+ leds_debug_off();\n// change state\nradio_vars.state = RADIOSTATE_RFOFF;\n@@ -170,6 +197,10 @@ void radio_loadPacket(uint8_t* packet, uint16_t len) {\n//at86rf215_readBurst(0x0306, packet, len);\n}\n+radio_state_t radio_getState(void){\n+ return radio_vars.state;\n+}\n+\nvoid radio_txEnable(void) {\n// change state\n@@ -177,20 +208,30 @@ void radio_txEnable(void) {\nat86rf215_spiStrobe(CMD_RF_TXPREP);\n// wiggle debug pin\ndebugpins_radio_set();\n- leds_radio_on();\n- at86rf215_spiReadReg(0);\n- while(radio_vars.state != RADIOSTATE_TX_ENABLED);\n- // change state\n-\n+ leds_debug_on();\n}\nvoid radio_txNow(void) {\n+\n+ PORT_TIMER_WIDTH capturedTime;\n+\n+ // check radio state transit to TRX PREPARE\n+ if (radio_vars.state != RADIOSTATE_TX_ENABLED){\n+ // return directly\n+ return;\n+ }\n+\n// change state\nradio_vars.state = RADIOSTATE_TRANSMITTING;\nat86rf215_spiStrobe(CMD_RF_TX);\n- while(radio_vars.state != RADIOSTATE_TXRX_DONE);\n- at86rf215_spiStrobe(RF_TRXOFF);\n+\n+ if (radio_vars.startFrame_cb!=NULL) {\n+ // capture the time\n+ capturedTime = sctimer_readCounter();\n+ // call the callback\n+ radio_vars.startFrame_cb(capturedTime);\n+ }\n}\n//===== RX\n@@ -200,14 +241,19 @@ void radio_rxEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_RX;\n// wiggle debug pin\ndebugpins_radio_set();\n- leds_radio_on();\n+ leds_debug_on();\nat86rf215_spiStrobe(CMD_RF_RX);\n+\n// change state\nradio_vars.state = RADIOSTATE_LISTENING;\n}\nvoid radio_rxNow(void) {\n//nothing to do\n+ if(at86rf215_status() != RF_STATE_RX){\n+ leds_error_toggle();\n+ return;\n+ }\n}\nvoid radio_getReceivedFrame(\n@@ -228,85 +274,80 @@ void radio_getReceivedFrame(\n//=========================== private =========================================\n-void radio_read_isr(uint8_t* rf09_isr){\n- at86rf215_read_isr(rf09_isr);\n+void radio_read_isr(void){\n+ uint8_t flags[4];\n+ at86rf215_read_isr(flags);\n+\n+ radio_vars.rf09_isr = flags[0];\n+ radio_vars.rf24_isr = flags[1];\n+ radio_vars.bb0_isr = flags[2];\n+ radio_vars.bb1_isr = flags[3];\n}\n+\n//=========================== callbacks =======================================\n//=========================== interrupt handlers ==============================\n-kick_scheduler_t radio_isr(void) {\n+void radio_isr(void) {\n+\nPORT_TIMER_WIDTH capturedTime;\n+ // kick_scheduler_t result = DO_NOT_KICK_SCHEDULER;\n+\n+ debugpins_isr_set();\n+\n+ GPIOPinIntClear(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN);\n+\n// capture the time\n- capturedTime = radiotimer_getCapturedTime();\n- switch(__even_in_range(P1IV,16)){\n- case 0:\n- break;\n- case 2:\n- break;\n- case 4:\n- break;\n- case 6:\n- break;\n- case 8:\n- break;\n- case 10:\n- P1IFG &= ~(BIT4);\n- radio_read_isr(&radio_vars.rf09_isr);\n+ capturedTime = sctimer_readCounter();\n+ //get isr that happened from radio\n+ radio_read_isr();\n+\nif (radio_vars.rf09_isr & IRQS_TRXRDY_MASK){\n- memset(&radio_vars.rf09_isr, 0, 4);\nradio_vars.state = RADIOSTATE_TX_ENABLED;\n+ // result = DO_NOT_KICK_SCHEDULER;\n}\n- else if (radio_vars.bb0_isr & IRQS_RXFS_MASK){\n- memset(&radio_vars.rf09_isr, 0, 4);\n- P4OUT ^= BIT2;\n+ if (radio_vars.bb0_isr & IRQS_RXFS_MASK){\nradio_vars.state = RADIOSTATE_RECEIVING;\nif (radio_vars.startFrame_cb!=NULL) {\n// call the callback\nradio_vars.startFrame_cb(capturedTime);\n// kick the OS\n- return KICK_SCHEDULER;\n+ // result = KICK_SCHEDULER;\n} else {\n- while(1);\n- }\n+ //while(1);\n}\n-\n- else if ((radio_vars.bb0_isr & IRQS_TXFE_MASK)){\n- P4OUT ^= BIT0;\n- memset(&radio_vars.rf09_isr, 0, 4);\n+ } else {\n+ if ((radio_vars.bb0_isr & IRQS_TXFE_MASK)){\nradio_vars.state = RADIOSTATE_TXRX_DONE;\nif (radio_vars.endFrame_cb!=NULL) {\n// call the callback\nradio_vars.endFrame_cb(capturedTime);\n// kick the OS\n- return KICK_SCHEDULER;\n+ // result = KICK_SCHEDULER;\n} else {\n- while(1);\n- }\n+ //while(1);\n}\n- else if ((radio_vars.bb0_isr & IRQS_RXFE_MASK)){\n- P4OUT ^= BIT0;\n- memset(&radio_vars.rf09_isr, 0, 4);\n+ } else {\n+ if ((radio_vars.bb0_isr & IRQS_RXFE_MASK)){\nradio_vars.state = RADIOSTATE_TXRX_DONE;\nif (radio_vars.endFrame_cb!=NULL) {\n// call the callback\nradio_vars.endFrame_cb(capturedTime);\n// kick the OS\n-\n- return KICK_SCHEDULER;\n-\n+ //result = KICK_SCHEDULER;\n} else {\n- while(1);\n+ // while(1);\n+ }\n+ }\n}\n}\n- break;\n- case 12:\n- break;\n- case 14:\n- break;\n- case 16:\n- break;\n+ radio_clear_isr();\n+ debugpins_isr_clr();\n}\n- return DO_NOT_KICK_SCHEDULER;\n+port_INLINE void radio_clear_isr(){\n+ radio_vars.rf09_isr = 0;\n+ radio_vars.rf24_isr = 0;\n+ radio_vars.bb0_isr = 0;\n+ radio_vars.bb1_isr = 0;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.h",
"new_path": "bsp/chips/at86rf215/radio.h",
"diff": "\\done by Jonathan Munoz <jonathan.munoz@inria.fr>\n*/\n-#include \"radiotimer.h\"\n+#include \"at86rf215.h\"\n//=========================== define ==========================================\n#define LENGTH_CRC 4\n+//=========================== typedef =========================================\n+\n/**\n\\brief Current state of the radio.\n@@ -47,30 +49,24 @@ typedef enum {\nRADIOSTATE_TURNING_OFF = 0x0d, ///< Turning the RF chain off.\n} radio_state_t;\n-//=========================== typedef =========================================\n+typedef void (*radio_capture_cbt)(PORT_TIMER_WIDTH timestamp);\n//=========================== variables =======================================\n//=========================== prototypes ======================================\n// admin\n+void radio_powerOn(void);\nvoid radio_init(void);\n-void radio_setOverflowCb(radiotimer_compare_cbt cb);\n-void radio_setCompareCb(radiotimer_compare_cbt cb);\n-void radio_setStartFrameCb(radiotimer_capture_cbt cb);\n-void radio_setEndFrameCb(radiotimer_capture_cbt cb);\n+void radio_setStartFrameCb(radio_capture_cbt cb);\n+void radio_setEndFrameCb(radio_capture_cbt cb);\n// reset\nvoid radio_reset(void);\n-// timer\n-void radio_startTimer(PORT_TIMER_WIDTH period);\n-PORT_TIMER_WIDTH radio_getTimerValue(void);\n-void radio_setTimerPeriod(PORT_TIMER_WIDTH period);\n-PORT_TIMER_WIDTH radio_getTimerPeriod(void);\n// RF admin\nvoid radio_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel);\nvoid radio_rfOn(void);\nvoid radio_rfOff(void);\n-void radio_change_modulation();\n+void radio_change_modulation(registerSetting_t * mod);\nvoid radio_change_size(uint16_t* size);\n// TX\nvoid radio_loadPacket(uint8_t* packet, uint16_t len);\n@@ -87,9 +83,8 @@ void radio_getReceivedFrame(uint8_t* bufRead,\nbool* crc,\nuint8_t* mcs);\n-\n// interrupt handlers\n-kick_scheduler_t radio_isr(void);\n+void radio_isr(void);\n/**\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/spi.c",
"new_path": "bsp/chips/at86rf215/spi.c",
"diff": "/**\n-\\brief msp430f5438a-specific definition of the \"spi\" bsp module.\n+\\brief definition of the \"spi\" bsp module.\n-\\author Jonathan Munoz <jonathan.munoz@inria.fr>, August 2016.\n+\\author Xavier Vilajosana <xvilajosana@eecs.berkeley.edu>, September 2017.\n*/\n-\n-#include \"msp430f5438a.h\"\n+#include \"board.h\"\n+#include \"board_info.h\"\n+#include \"ssi.h\"\n#include \"spi.h\"\n-#include \"leds.h\"\n-#include \"bsp.h\"\n+#include \"gpio.h\"\n+#include \"ioc.h\"\n+#include \"sys_ctrl.h\"\n+\n+#include <headers/hw_ints.h>\n+#include <headers/hw_ioc.h>\n+#include <headers/hw_memmap.h>\n+#include <headers/hw_ssi.h>\n+#include <headers/hw_sys_ctrl.h>\n+#include <headers/hw_types.h>\n+\n//=========================== defines =========================================\n+#define SPI_PIN_SSI_CLK GPIO_PIN_2 // CLK\n+#define SPI_PIN_SSI_FSS GPIO_PIN_3 // CSn\n+#define SPI_PIN_SSI_RX GPIO_PIN_4 // MISO\n+#define SPI_PIN_SSI_TX GPIO_PIN_5 // MOSI\n+#define SPI_GPIO_SSI_BASE GPIO_A_BASE\n//=========================== variables =======================================\n@@ -34,59 +49,44 @@ typedef struct {\nspi_vars_t spi_vars;\n//=========================== prototypes ======================================\n-\n+static void disableInterrupts(void);\n+static void enableInterrupts(void);\n//=========================== public ==========================================\n-void spi_init(void) {\n+void spi_init() {\n// clear variables\nmemset(&spi_vars,0,sizeof(spi_vars_t));\n- UCB0CTL1 |= UCSWRST ; // reset state\n-\n- // RF SPI0 CS as GPIO output high\n- //\n- P3SEL &= ~TRXEM_SPI_SC_N_PIN;\n- P3OUT |= TRXEM_SPI_SC_N_PIN;\n- P3DIR |= TRXEM_SPI_SC_N_PIN;\n- // Configuration\n- // - 8-bit\n- // - Master Mode\n- //- 3-pin\n- // - synchronous mode\n- // - MSB first\n- // - Clock phase select = captured on first edge\n- // - Inactive state is low\n- // - SMCLK as clock source\n- // - Spi clk is adjusted corresponding to systemClock as the highest rate\n- // supported by the supported radios: this could be optimized and done\n- // after chip detect.\n-\n- UCB0CTL0 = 0x00+UCMST + UCSYNC + UCMODE_0 + UCMSB + UCCKPH;\n- UCB0CTL1 |= UCSSEL_2;\n- UCB0BR1 = 0x00;\n- UCB0BR0 = 0x06;\n- // Configure port and pins\n- // - MISO/MOSI/SCLK GPIO controlled by peripheral\n- // - CS_n GPIO controlled manually, set to 1\n-\n- P3SEL |= TRXEM_SPI_MOSI_PIN | TRXEM_SPI_MISO_PIN | TRXEM_SPI_SCLK_PIN ;\n- P3SEL &= ~TRXEM_SPI_SC_N_PIN ;\n- P3OUT |= TRXEM_SPI_SC_N_PIN | TRXEM_SPI_MISO_PIN ;/* Pullup on MISO */\n-\n- P3DIR |= TRXEM_SPI_SC_N_PIN;\n- // In case not automatically set\n- P3DIR |= TRXEM_SPI_MOSI_PIN | TRXEM_SPI_SCLK_PIN ;\n- P3DIR &= ~TRXEM_SPI_MISO_PIN ;\n-\n- UCB0CTL1 &= ~UCSWRST;\n-\n- // enable interrupts via the IEx SFRs\n-#ifdef SPI_IN_INTERRUPT_MODE\n- UCB0IE |= UCRXIE; // we only enable the SPI RX interrupt\n- // since TX and RX happen concurrently,\n- // i.e. an RX completion necessarily\n- // implies a TX completion.\n-#endif\n+ // set the clk miso and cs pins as output\n+ GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK);\n+ GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX);\n+ GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS);\n+\n+ //set cs to high\n+ GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, SPI_PIN_SSI_FSS);\n+ //set pins to low\n+ GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX, 0);\n+ GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK, 0);\n+\n+ SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_SSI0);\n+ SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_SSI0);\n+ SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI0);\n+\n+ SSIDisable(SSI0_BASE);\n+ SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_PIOSC);\n+\n+ IOCPinConfigPeriphOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK, IOC_MUX_OUT_SEL_SSI0_CLKOUT);\n+ IOCPinConfigPeriphOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX, IOC_MUX_OUT_SEL_SSI0_TXD);\n+ IOCPinConfigPeriphInput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_RX, IOC_SSIRXD_SSI0);\n+\n+ GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK );\n+ GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_RX );\n+ GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX );\n+\n+ SSIConfigSetExpClk(SSI0_BASE, SysCtrlIOClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, /*SysCtrlIOClockGet()/2*/16000000, 8);\n+\n+ // Enable the SSI0 module.\n+ SSIEnable(SSI0_BASE);\n}\n#ifdef SPI_IN_INTERRUPT_MODE\n@@ -103,11 +103,8 @@ void spi_txrx(uint8_t* bufTx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n-#ifdef SPI_IN_INTERRUPT_MODE\n- // disable interrupts\n- __disable_interrupt();\n-#endif\n-\n+ uint32_t data,i;\n+ GPIOPinWrite(GPIO_B_BASE, GPIO_PIN_1, GPIO_PIN_1);\n// register spi frame to send\nspi_vars.pNextTxByte = bufTx;\nspi_vars.numTxedBytes = 0;\n@@ -122,94 +119,81 @@ void spi_txrx(uint8_t* bufTx,\nspi_vars.busy = 1;\n// lower CS signal to have slave listening\n- /* Pull CS_N low and wait for SO to go low before communication starts */\nif (spi_vars.isFirst==SPI_FIRST) {\n- TRXEM_SPI_BEGIN();\n- while(P3IN & TRXEM_SPI_MISO_PIN);\n+ GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, 0);\n}\n-#ifdef SPI_IN_INTERRUPT_MODE\n- // implementation 1. use a callback function when transaction finishes\n+ for ( i = 0; i < lenbufTx; i++)\n+ {\n+ // Push a byte\n+ SSIDataPut(SSI0_BASE, spi_vars.pNextTxByte[i]);\n- // write first byte to TX buffer\n- UCB0TXBUF = *spi_vars.pNextTxByte;\n+ // Wait until it is complete\n+ while(SSIBusy(SSI0_BASE));\n- // re-enable interrupts\n- __enable_interrupt();\n-#else\n+ // Read a byte\n+ SSIDataGet(SSI0_BASE, &data);\n- // send all bytes\n- while (spi_vars.txBytesLeft>0) {\n-\n- TRXEM_SPI_TX(*spi_vars.pNextTxByte);\n- // busy wait on the interrupt flag\n- while ((UCB0IFG & UCRXIFG)==0);\n- // save the byte just received in the RX buffer\n- switch (spi_vars.returnType) {\n- case SPI_FIRSTBYTE:\n- if (spi_vars.numTxedBytes==0) {\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- }\n- break;\n- case SPI_BUFFER:\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- spi_vars.pNextRxByte++;\n- break;\n- case SPI_LASTBYTE:\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- break;\n- }\n+ // Store the result\n+ spi_vars.pNextRxByte[i] = (uint8_t)(data & 0xFF);\n// one byte less to go\n- spi_vars.pNextTxByte++;\n- spi_vars.numTxedBytes++;\n- spi_vars.txBytesLeft--;\n}\n- // put CS signal high to signal end of transmission to slave\nif (spi_vars.isLast==SPI_LAST) {\n- TRXEM_SPI_END();\n+ GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, SPI_PIN_SSI_FSS);\n}\n// SPI is not busy anymore\nspi_vars.busy = 0;\n-#endif\n+ GPIOPinWrite(GPIO_B_BASE, GPIO_PIN_1, 0);\n}\n//=========================== private =========================================\n+port_INLINE void enableInterrupts(void)\n+{\n+ // Enable the SPI interrupt\n+ SSIIntEnable(SSI0_BASE, (SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR));\n+\n+ // Enable the SPI interrupt\n+ IntEnable(INT_SSI0);\n+}\n+\n+port_INLINE void disableInterrupts(void)\n+{\n+ // Disable the SPI interrupt\n+ SSIIntDisable(SSI0_BASE, (SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR));\n+\n+ // Disable the SPI interrupt\n+ IntDisable(INT_SSI0);\n+}\n+\n//=========================== interrupt handlers ==============================\n-kick_scheduler_t spi_isr(void) {\n+kick_scheduler_t spi_isr() {\n#ifdef SPI_IN_INTERRUPT_MODE\n+ uint32_t data;\n// save the byte just received in the RX buffer\n- switch (spi_vars.returnType) {\n- case SPI_FIRSTBYTE:\n- if (spi_vars.numTxedBytes==0) {\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- }\n- break;\n- case SPI_BUFFER:\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- spi_vars.pNextRxByte++;\n- break;\n- case SPI_LASTBYTE:\n- *spi_vars.pNextRxByte = UCB0RXBUF;\n- break;\n- }\n+ status = SSIIntStatus(SSI0_BASE, true);\n+\n+ // Clear SPI interrupt in the NVIC\n+ IntPendClear(INT_SSI0);\n+\n+ SSIDataGet(SSI0_BASE, &data);\n+\n+ // Store the result\n+ spi_vars.pNextRxByte = (uint8_t)(data & 0xFF);\n// one byte less to go\nspi_vars.pNextTxByte++;\n- spi_vars.numTxedBytes++;\n+ spi_vars.pNextRxByte++;\nspi_vars.txBytesLeft--;\nif (spi_vars.txBytesLeft>0) {\n// write next byte to TX buffer\n- UCB0TXBUF = *spi_vars.pNextTxByte;\n+ SSIDataPut(SSI0_BASE, *spi_vars.pNextTxByte);\n+\n} else {\n- // put CS signal high to signal end of transmission to slave\n- if (spi_vars.isLast==SPI_LAST) {\n- P3OUT |= 0x01;\n- }\n// SPI is not busy anymore\nspi_vars.busy = 0;\n@@ -221,16 +205,7 @@ kick_scheduler_t spi_isr(void) {\nreturn KICK_SCHEDULER;\n}\n}\n- return DO_NOT_KICK_SCHEDULER;\n-#else\n- // this should never happpen!\n- // we can not print from within the BSP. Instead:\n- // blink the error LED\n- leds_error_blink();\n- // reset the board\n- board_reset();\n-\n- return DO_NOT_KICK_SCHEDULER; // we will not get here, statement to please compiler\n#endif\n+ return DO_NOT_KICK_SCHEDULER;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/openmote-b-subghz/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\common\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\si70x\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\kernel\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\drivers\\common\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\inc\\</state>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n</group>\n<group>\n<name>chips</name>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\spi.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\spi.h</name>\n+ </file>\n+ </group>\n<group>\n<name>si70x</name>\n<file>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. update radio driver.
|
491,595 |
25.09.2018 12:02:20
| -7,200 |
42923f1a920fc8f2a62888f3084a33bfb99264fc
|
move spi.c to board folder and update spi interface to support lenBytes > 255
|
[
{
"change_type": "RENAME",
"old_path": "bsp/chips/at86rf215/spi.c",
"new_path": "bsp/boards/openmote-b-subghz/spi.c",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/spi.h",
"new_path": "bsp/boards/spi.h",
"diff": "@@ -54,10 +54,10 @@ void spi_init(void);\nvoid spi_setCb(spi_cbt cb);\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast);\n"
},
{
"change_type": "DELETE",
"old_path": "bsp/chips/at86rf215/spi.h",
"new_path": null,
"diff": "-/**\n-\\brief Cross-platform declaration \"spi\" bsp module.\n-\n-\\author Thomas Watteyne <watteyne@eecs.berkeley.edu>, February 2012.\n-*/\n-\n-#ifndef __SPI_H\n-#define __SPI_H\n-\n-#include \"stdint.h\"\n-#include \"board.h\"\n-\n-//=========================== define ==========================================\n-\n-/**\n-The SPI module functions in two modes:\n-- in \"blocking\" mode, all calls return only when the module is done. the CPU\n- is not available while the module is busy. This is the preferred method is\n- low-RAM system which can not run an RTOS\n-- in \"interrupt\" mode, calls are returned after the module has started a\n- transaction. When the transaction is done, the module uses a callback\n- function to signal this to the caller. This frees up CPU time, allowing for\n- other operations to happen concurrently. This is the preferred method when an\n- RTOS is present.\n-*/\n-//#define SPI_IN_INTERRUPT_MODE\n-\n-//=========================== typedef =========================================\n-\n-typedef enum {\n- SPI_FIRSTBYTE = 0,\n- SPI_BUFFER = 1,\n- SPI_LASTBYTE = 2,\n-} spi_return_t;\n-\n-typedef enum {\n- SPI_NOTFIRST = 0,\n- SPI_FIRST = 1,\n-} spi_first_t;\n-\n-typedef enum {\n- SPI_NOTLAST = 0,\n- SPI_LAST = 1,\n-} spi_last_t;\n-\n-typedef void (*spi_cbt)(void);\n-\n-//=========================== variables =======================================\n-\n-//=========================== prototypes ======================================\n-\n-void spi_init(void);\n-#ifdef SPI_IN_INTERRUPT_MODE\n-void spi_setCb(spi_cbt cb);\n-#endif\n-void spi_txrx(uint8_t* bufTx,\n- uint16_t lenbufTx,\n- spi_return_t returnType,\n- uint8_t* bufRx,\n- uint16_t maxLenBufRx,\n- spi_first_t isFirst,\n- spi_last_t isLast);\n-\n-// interrupt handlers\n-kick_scheduler_t spi_isr(void);\n-\n-#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/03oos_openwsn/03oos_openwsn.ewp",
"new_path": "projects/openmote-b-subghz/03oos_openwsn/03oos_openwsn.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_iar.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\spi.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\spi.h</name>\n- </file>\n</group>\n<group>\n<name>si70x</name>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. move spi.c to board folder and update spi interface to support lenBytes > 255
|
491,595 |
25.09.2018 12:14:18
| -7,200 |
b98b6861e9748cc27baecca6b59a5bed6df3814d
|
update spi_txrx function interface for other boards.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/gina/spi.c",
"new_path": "bsp/boards/gina/spi.c",
"diff": "@@ -77,10 +77,10 @@ void spi_setCallback(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/iot-lab_A8-M3/spi.c",
"new_path": "bsp/boards/iot-lab_A8-M3/spi.c",
"diff": "@@ -103,10 +103,10 @@ void spi_setCallback(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/iot-lab_M3/spi.c",
"new_path": "bsp/boards/iot-lab_M3/spi.c",
"diff": "@@ -105,10 +105,10 @@ void spi_setCallback(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmotestm/spi.c",
"new_path": "bsp/boards/openmotestm/spi.c",
"diff": "@@ -102,10 +102,10 @@ void spi_setCallback(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/samr21_xpro/spi_drv.c",
"new_path": "bsp/boards/samr21_xpro/spi_drv.c",
"diff": "@@ -131,10 +131,10 @@ void spi_setCallback(spi_cbt cb)\n*\n*/\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast)\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/telosb/spi.c",
"new_path": "bsp/boards/telosb/spi.c",
"diff": "@@ -105,10 +105,10 @@ void spi_setCb(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/wsn430v13b/spi.c",
"new_path": "bsp/boards/wsn430v13b/spi.c",
"diff": "@@ -108,10 +108,10 @@ void spi_setCb(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/wsn430v14/spi.c",
"new_path": "bsp/boards/wsn430v14/spi.c",
"diff": "@@ -124,10 +124,10 @@ void spi_setCb(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/z1/spi.c",
"new_path": "bsp/boards/z1/spi.c",
"diff": "@@ -80,10 +80,10 @@ void spi_setCallback(spi_cbt cb) {\n#endif\nvoid spi_txrx(uint8_t* bufTx,\n- uint8_t lenbufTx,\n+ uint16_t lenbufTx,\nspi_return_t returnType,\nuint8_t* bufRx,\n- uint8_t maxLenBufRx,\n+ uint16_t maxLenBufRx,\nspi_first_t isFirst,\nspi_last_t isLast) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. update spi_txrx function interface for other boards.
|
491,595 |
25.09.2018 12:15:30
| -7,200 |
445db940896032e37965bcb2f12e6bda449836ed
|
add radio.c and at86rf215.c files to openmote-b-subghz scons builder system.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/SConscript",
"new_path": "bsp/boards/openmote-b-subghz/SConscript",
"diff": "@@ -10,6 +10,12 @@ si70x = localEnv.SConscript(\nexports = {'env': env},\n)\n+rf215 = localEnv.SConscript(\n+ os.path.join('#','bsp','chips','at86rf215','SConscript'),\n+ variant_dir = 'rf215',\n+ exports = {'env': env},\n+)\n+\nsource = \\\n[file for file in Glob('*.c') if file.name.find('iar')==-1] + \\\nGlob('source/*.c')\n@@ -20,9 +26,10 @@ localEnv.Append(\nos.path.join('#','bsp','boards','openmote-b-subghz','headers'),\nos.path.join('#','bsp','boards','openmote-b-subghz','source'),\nos.path.join('#','bsp','chips','si70x'),\n+ os.path.join('#','bsp','chips','rf215'),\n],\n)\n-board = localEnv.Object(source=source) + si70x\n+board = localEnv.Object(source=source) + si70x + rf215\nReturn('board')\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/SConscript",
"new_path": "bsp/chips/at86rf215/SConscript",
"diff": "@@ -7,7 +7,7 @@ Import('env')\nlocalEnv = env.Clone()\n-source = ['radio.c']\n-rf231 = localEnv.Object(source=source)\n+source = ['radio.c', 'at86rf215.c']\n+rf215 = localEnv.Object(source=source)\n-Return('rf231')\n\\ No newline at end of file\n+Return('rf215')\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. add radio.c and at86rf215.c files to openmote-b-subghz scons builder system.
|
491,595 |
25.09.2018 14:31:29
| -7,200 |
c6b4f3b2194b29cac10f4a595eddd8fc041e71fe
|
using FSK option 1 in maximum transmitting power .
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3990,7 +3990,7 @@ static const registerSetting_t basic_settings_fsk_option1 []={\n{RG_RF09_EDD, 0x7A},\n{RG_RF09_TXCUTC, 0xC0},\n{RG_RF09_TXDFE, 0x98},\n- {RG_RF09_PAC, 0x64},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n+ {RG_RF09_PAC, 0x1F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n{RG_BBC0_IRQM, 0x1F},// TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled\n{RG_BBC1_IRQM, 0x00},\n{RG_BBC0_PC, 0x1D},// No FCS filter, 32 bits FCS, FSK.\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -115,9 +115,9 @@ void radio_init(void) {\nif ((at86rf215_spiReadReg(RG_RF_PN) != 0x34) | (at86rf215_spiReadReg(RG_RF_VN) != 0x03)) {\nwhile(1); //UNKNOWN DEVICE, FINISH\n}\n- // Write registers to radio -- default configuration OFDM 400kbps\n+ // Write registers to radio -- configuration 2-FSK-50kbps\nfor( i = 0; i < (sizeof(basic_settings_ofdm_1_mcs2)/sizeof(registerSetting_t)); i++) {\n- at86rf215_spiWriteReg( basic_settings_ofdm_1_mcs2[i].addr, basic_settings_ofdm_1_mcs2[i].data);\n+ at86rf215_spiWriteReg( basic_settings_fsk_option1[i].addr, basic_settings_fsk_option1[i].data);\n};\nradio_read_isr();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. using FSK option 1 in maximum transmitting power .
|
491,595 |
25.09.2018 14:54:20
| -7,200 |
5e2090022781e23ddc98426feed8453c7127381a
|
remove the radio.c file for subghz port.
|
[
{
"change_type": "DELETE",
"old_path": "bsp/boards/openmote-b-subghz/radio.c",
"new_path": null,
"diff": "-/**\n- * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu)\n- * Pere Tuset (peretuset@openmote.com)\n- * Date: July 2013\n- * Description: CC2538-specific definition of the \"radio\" bsp module.\n- */\n-\n-#include <stdio.h>\n-#include <string.h>\n-\n-#include <headers/hw_ana_regs.h>\n-#include <headers/hw_ints.h>\n-#include <headers/hw_rfcore_sfr.h>\n-#include <headers/hw_rfcore_sfr.h>\n-#include <headers/hw_rfcore_xreg.h>\n-#include <headers/hw_types.h>\n-\n-#include <source/interrupt.h>\n-#include <source/sys_ctrl.h>\n-\n-#include \"board.h\"\n-#include \"cc2538rf.h\"\n-#include \"debugpins.h\"\n-#include \"leds.h\"\n-#include \"radio.h\"\n-#include \"sctimer.h\"\n-\n-//=========================== defines =========================================\n-\n-/* Bit Masks for the last byte in the RX FIFO */\n-#define CRC_BIT_MASK 0x80\n-#define LQI_BIT_MASK 0x7F\n-\n-/* RSSI Offset */\n-#define RSSI_OFFSET 73\n-#define CHECKSUM_LEN 2\n-\n-//=========================== variables =======================================\n-\n-typedef struct {\n- radio_capture_cbt startFrame_cb;\n- radio_capture_cbt endFrame_cb;\n- radio_state_t state;\n-} radio_vars_t;\n-\n-radio_vars_t radio_vars;\n-\n-//=========================== prototypes ======================================\n-\n-void enable_radio_interrupts(void);\n-void disable_radio_interrupts(void);\n-\n-void radio_on(void);\n-void radio_off(void);\n-\n-void radio_error_isr(void);\n-void radio_isr_internal(void);\n-\n-//=========================== public ==========================================\n-\n-//===== admin\n-\n-void radio_init(void) {\n-\n- // clear variables\n- memset(&radio_vars,0,sizeof(radio_vars_t));\n-\n- // change state\n- radio_vars.state = RADIOSTATE_STOPPED;\n- //flush fifos\n- CC2538_RF_CSP_ISFLUSHRX();\n- CC2538_RF_CSP_ISFLUSHTX();\n-\n- radio_off();\n-\n- //disable radio interrupts\n- disable_radio_interrupts();\n-\n- /*\n- This CORR_THR value should be changed to 0x14 before attempting RX. Testing has shown that\n- too many false frames are received if the reset value is used. Make it more likely to detect\n- sync by removing the requirement that both symbols in the SFD must have a correlation value\n- above the correlation threshold, and make sync word detection less likely by raising the\n- correlation threshold.\n- */\n- HWREG(RFCORE_XREG_MDMCTRL1) = 0x14;\n- /* tuning adjustments for optimal radio performance; details available in datasheet */\n-\n- HWREG(RFCORE_XREG_RXCTRL) = 0x3F;\n- /* Adjust current in synthesizer; details available in datasheet. */\n- HWREG(RFCORE_XREG_FSCTRL) = 0x55;\n-\n- /* Makes sync word detection less likely by requiring two zero symbols before the sync word.\n- * details available in datasheet.\n- */\n- HWREG(RFCORE_XREG_MDMCTRL0) = 0x85;\n-\n- /* Adjust current in VCO; details available in datasheet. */\n- HWREG(RFCORE_XREG_FSCAL1) = 0x01;\n- /* Adjust target value for AGC control loop; details available in datasheet. */\n- HWREG(RFCORE_XREG_AGCCTRL1) = 0x15;\n-\n- /* Tune ADC performance, details available in datasheet. */\n- HWREG(RFCORE_XREG_ADCTEST0) = 0x10;\n- HWREG(RFCORE_XREG_ADCTEST1) = 0x0E;\n- HWREG(RFCORE_XREG_ADCTEST2) = 0x03;\n-\n- //update CCA register to -81db as indicated by manual.. won't be used..\n- HWREG(RFCORE_XREG_CCACTRL0) = 0xF8;\n- /*\n- * Changes from default values\n- * See User Guide, section \"Register Settings Update\"\n- */\n- HWREG(RFCORE_XREG_TXFILTCFG) = 0x09; /** TX anti-aliasing filter bandwidth */\n- HWREG(RFCORE_XREG_AGCCTRL1) = 0x15; /** AGC target value */\n- HWREG(ANA_REGS_O_IVCTRL) = 0x0B; /** Bias currents */\n-\n- /* disable the CSPT register compare function */\n- HWREG(RFCORE_XREG_CSPT) = 0xFFUL;\n- /*\n- * Defaults:\n- * Auto CRC; Append RSSI, CRC-OK and Corr. Val.; CRC calculation;\n- * RX and TX modes with FIFOs\n- */\n- HWREG(RFCORE_XREG_FRMCTRL0) = RFCORE_XREG_FRMCTRL0_AUTOCRC;\n-\n- //poipoi disable frame filtering by now.. sniffer mode.\n- HWREG(RFCORE_XREG_FRMFILT0) &= ~RFCORE_XREG_FRMFILT0_FRAME_FILTER_EN;\n-\n- /* Disable source address matching and autopend */\n- HWREG(RFCORE_XREG_SRCMATCH) = 0;\n-\n- /* MAX FIFOP threshold */\n- HWREG(RFCORE_XREG_FIFOPCTRL) = CC2538_RF_MAX_PACKET_LEN;\n-\n- HWREG(RFCORE_XREG_TXPOWER) = CC2538_RF_TX_POWER;\n- HWREG(RFCORE_XREG_FREQCTRL) = CC2538_RF_CHANNEL_MIN;\n-\n- /* Enable RF interrupts see page 751 */\n- // enable_radio_interrupts();\n-\n- //register interrupt\n- IntRegister(INT_RFCORERTX, radio_isr_internal);\n- IntRegister(INT_RFCOREERR, radio_error_isr);\n-\n- IntEnable(INT_RFCORERTX);\n-\n- /* Enable all RF Error interrupts */\n- HWREG(RFCORE_XREG_RFERRM) = RFCORE_XREG_RFERRM_RFERRM_M; //all errors\n- IntEnable(INT_RFCOREERR);\n- //radio_on();\n-\n- // change state\n- radio_vars.state = RADIOSTATE_RFOFF;\n-}\n-\n-void radio_setStartFrameCb(radio_capture_cbt cb) {\n- radio_vars.startFrame_cb = cb;\n-}\n-\n-void radio_setEndFrameCb(radio_capture_cbt cb) {\n- radio_vars.endFrame_cb = cb;\n-}\n-\n-//===== reset\n-\n-void radio_reset(void) {\n- /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */\n- while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);\n-\n- //flush fifos\n- CC2538_RF_CSP_ISFLUSHRX();\n- CC2538_RF_CSP_ISFLUSHTX();\n-\n- /* Don't turn off if we are off as this will trigger a Strobe Error */\n- if(HWREG(RFCORE_XREG_RXENABLE) != 0) {\n- CC2538_RF_CSP_ISRFOFF();\n- }\n- radio_init();\n-}\n-\n-//===== RF admin\n-\n-void radio_setFrequency(uint8_t frequency) {\n-\n- // change state\n- radio_vars.state = RADIOSTATE_SETTING_FREQUENCY;\n-\n- radio_off();\n- // configure the radio to the right frequecy\n- if((frequency < CC2538_RF_CHANNEL_MIN) || (frequency > CC2538_RF_CHANNEL_MAX)) {\n- while(1);\n- }\n-\n- /* Changes to FREQCTRL take effect after the next recalibration */\n- HWREG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN\n- + (frequency - CC2538_RF_CHANNEL_MIN) * CC2538_RF_CHANNEL_SPACING);\n-\n- //radio_on();\n-\n- // change state\n- radio_vars.state = RADIOSTATE_FREQUENCY_SET;\n-}\n-\n-void radio_rfOn(void) {\n- //radio_on();\n-}\n-\n-void radio_rfOff(void) {\n-\n- // change state\n- radio_vars.state = RADIOSTATE_TURNING_OFF;\n- radio_off();\n- // wiggle debug pin\n- debugpins_radio_clr();\n- leds_radio_off();\n- //enable radio interrupts\n- disable_radio_interrupts();\n-\n- // change state\n- radio_vars.state = RADIOSTATE_RFOFF;\n-}\n-\n-//===== TX\n-\n-void radio_loadPacket(uint8_t* packet, uint16_t len) {\n- uint8_t i=0;\n-\n- // change state\n- radio_vars.state = RADIOSTATE_LOADING_PACKET;\n-\n- // load packet in TXFIFO\n- /*\n- When we transmit in very quick bursts, make sure previous transmission\n- is not still in progress before re-writing to the TX FIFO\n- */\n- while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);\n-\n- CC2538_RF_CSP_ISFLUSHTX();\n-\n- /* Send the phy length byte first */\n- HWREG(RFCORE_SFR_RFDATA) = len; //crc len is included\n-\n- for(i = 0; i < len; i++) {\n- HWREG(RFCORE_SFR_RFDATA) = packet[i];\n- }\n-\n- // change state\n- radio_vars.state = RADIOSTATE_PACKET_LOADED;\n-}\n-\n-void radio_txEnable(void) {\n-\n- // change state\n- radio_vars.state = RADIOSTATE_ENABLING_TX;\n-\n- // wiggle debug pin\n- debugpins_radio_set();\n- leds_radio_on();\n-\n- //do nothing -- radio is activated by the strobe on rx or tx\n- //radio_rfOn();\n-\n- // change state\n- radio_vars.state = RADIOSTATE_TX_ENABLED;\n-}\n-\n-void radio_txNow(void) {\n- PORT_TIMER_WIDTH count;\n-\n- // change state\n- radio_vars.state = RADIOSTATE_TRANSMITTING;\n-\n- //enable radio interrupts\n- enable_radio_interrupts();\n-\n- //make sure we are not transmitting already\n- while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);\n-\n- // send packet by STON strobe see pag 669\n-\n- CC2538_RF_CSP_ISTXON();\n- //wait 192uS\n- count=0;\n- while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE))){\n- count++; //debug\n- }\n-}\n-\n-//===== RX\n-\n-void radio_rxEnable(void) {\n-\n- // change state\n- radio_vars.state = RADIOSTATE_ENABLING_RX;\n-\n- //enable radio interrupts\n-\n- // do nothing as we do not want to receive anything yet.\n- // wiggle debug pin\n- debugpins_radio_set();\n- leds_radio_on();\n-\n- // change state\n- radio_vars.state = RADIOSTATE_LISTENING;\n-}\n-\n-void radio_rxNow(void) {\n- //empty buffer before receiving\n- //CC2538_RF_CSP_ISFLUSHRX();\n-\n- //enable radio interrupts\n- CC2538_RF_CSP_ISFLUSHRX();\n- enable_radio_interrupts();\n-\n- CC2538_RF_CSP_ISRXON();\n- // busy wait until radio really listening\n- while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_RX_ACTIVE)));\n-}\n-\n-void radio_getReceivedFrame(uint8_t* pBufRead,\n- uint8_t* pLenRead,\n- uint8_t maxBufLen,\n- int8_t* pRssi,\n- uint8_t* pLqi,\n- bool* pCrc) {\n- uint8_t crc_corr,i;\n-\n- uint8_t len=0;\n-\n- /* Check the length */\n- len = HWREG(RFCORE_SFR_RFDATA); //first byte is len\n-\n-\n- /* Check for validity */\n- if(len > CC2538_RF_MAX_PACKET_LEN) {\n- /* wrong len */\n- CC2538_RF_CSP_ISFLUSHRX();\n- return;\n- }\n-\n-\n- if(len <= CC2538_RF_MIN_PACKET_LEN) {\n- //too short\n- CC2538_RF_CSP_ISFLUSHRX();\n- return;\n- }\n-\n- //check if this fits to the buffer\n- if(len > maxBufLen) {\n- CC2538_RF_CSP_ISFLUSHRX();\n- return;\n- }\n-\n- // when reading the packet from the RX buffer, you get the following:\n- // - *[1B] length byte\n- // - [0-125B] packet (excluding CRC)\n- // - [1B] RSSI\n- // - *[2B] CRC\n-\n- //skip first byte is len\n- for(i = 0; i < len - 2; i++) {\n- pBufRead[i] = HWREG(RFCORE_SFR_RFDATA);\n- }\n-\n- *pRssi = ((int8_t)(HWREG(RFCORE_SFR_RFDATA)) - RSSI_OFFSET);\n- crc_corr = HWREG(RFCORE_SFR_RFDATA);\n- *pCrc = crc_corr & CRC_BIT_MASK;\n- *pLenRead = len;\n-\n- //flush it\n- CC2538_RF_CSP_ISFLUSHRX();\n-}\n-\n-//=========================== private =========================================\n-\n-void enable_radio_interrupts(void){\n- /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */\n- HWREG(RFCORE_XREG_RFIRQM0) |= ((0x06|0x02|0x01) << RFCORE_XREG_RFIRQM0_RFIRQM_S) & RFCORE_XREG_RFIRQM0_RFIRQM_M;\n-\n- /* Enable RF interrupts 1, TXDONE only */\n- HWREG(RFCORE_XREG_RFIRQM1) |= ((0x02) << RFCORE_XREG_RFIRQM1_RFIRQM_S) & RFCORE_XREG_RFIRQM1_RFIRQM_M;\n-}\n-\n-void disable_radio_interrupts(void){\n- /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */\n- HWREG(RFCORE_XREG_RFIRQM0) = 0;\n- /* Enable RF interrupts 1, TXDONE only */\n- HWREG(RFCORE_XREG_RFIRQM1) = 0;\n-}\n-\n-void radio_on(void){\n- // CC2538_RF_CSP_ISFLUSHRX();\n- CC2538_RF_CSP_ISRXON();\n-}\n-\n-void radio_off(void){\n- /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */\n- while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);\n- //CC2538_RF_CSP_ISFLUSHRX();\n-\n- /* Don't turn off if we are off as this will trigger a Strobe Error */\n- if(HWREG(RFCORE_XREG_RXENABLE) != 0) {\n- CC2538_RF_CSP_ISRFOFF();\n- //clear fifo isr flag\n- HWREG(RFCORE_SFR_RFIRQF0) = ~(RFCORE_SFR_RFIRQF0_FIFOP|RFCORE_SFR_RFIRQF0_RXPKTDONE);\n- }\n-}\n-\n-//=========================== callbacks =======================================\n-\n-//=========================== interrupt handlers ==============================\n-\n-/**\n-\\brief Stub function for the CC2538.\n-\n-In MSP430 platforms the CPU status after servicing an interrupt can be managed\n-toggling some bits in a special register, e.g. CPUOFF, LPM1, etc, within the\n-interrupt context itself. By default, after servicing an interrupt the CPU will\n-be off so it makes sense to return a value and enable it if something has\n-happened that needs the scheduler to run (a packet has been received that needs\n-to be processed). Otherwise, the CPU is kept in sleep mode without even\n-reaching the main loop.\n-\n-In the CC2538, however, the default behaviour is the contrary. After servicing\n-an interrupt the CPU will be on by default and it is the responsability of the\n-main thread to put it back to sleep (which is already done). This means that\n-the scheduler will always be kicked in after servicing an interrupt. This\n-behaviour can be changed by modifying the SLEEPEXIT field in the SYSCTRL\n-regiser (see page 131 of the CC2538 manual).\n-*/\n-kick_scheduler_t radio_isr(void) {\n- return DO_NOT_KICK_SCHEDULER;\n-}\n-\n-void radio_isr_internal(void) {\n- volatile PORT_TIMER_WIDTH capturedTime;\n- uint8_t irq_status0,irq_status1;\n-\n- debugpins_isr_set();\n-\n- // capture the time\n- capturedTime = sctimer_readCounter();\n-\n- // reading IRQ_STATUS\n- irq_status0 = HWREG(RFCORE_SFR_RFIRQF0);\n- irq_status1 = HWREG(RFCORE_SFR_RFIRQF1);\n-\n- IntPendClear(INT_RFCORERTX);\n-\n- //clear interrupt\n- HWREG(RFCORE_SFR_RFIRQF0) = 0;\n- HWREG(RFCORE_SFR_RFIRQF1) = 0;\n-\n- //STATUS0 Register\n- // start of frame event\n- if ((irq_status0 & RFCORE_SFR_RFIRQF0_SFD) == RFCORE_SFR_RFIRQF0_SFD) {\n- // change state\n- radio_vars.state = RADIOSTATE_RECEIVING;\n- if (radio_vars.startFrame_cb!=NULL) {\n- // call the callback\n- radio_vars.startFrame_cb(capturedTime);\n- debugpins_isr_clr();\n- // kick the OS\n- return;\n- } else {\n- while(1);\n- }\n- }\n-\n- //or RXDONE is full -- we have a packet.\n- if (((irq_status0 & RFCORE_SFR_RFIRQF0_RXPKTDONE) == RFCORE_SFR_RFIRQF0_RXPKTDONE)) {\n- // change state\n- radio_vars.state = RADIOSTATE_TXRX_DONE;\n- if (radio_vars.endFrame_cb!=NULL) {\n- // call the callback\n- radio_vars.endFrame_cb(capturedTime);\n- debugpins_isr_clr();\n- // kick the OS\n- return;\n- } else {\n- while(1);\n- }\n- }\n-\n- // or FIFOP is full -- we have a packet.\n- if (((irq_status0 & RFCORE_SFR_RFIRQF0_FIFOP) == RFCORE_SFR_RFIRQF0_FIFOP)) {\n- // change state\n- radio_vars.state = RADIOSTATE_TXRX_DONE;\n- if (radio_vars.endFrame_cb!=NULL) {\n- // call the callback\n- radio_vars.endFrame_cb(capturedTime);\n- debugpins_isr_clr();\n- // kick the OS\n- return;\n- } else {\n- while(1);\n- }\n- }\n-\n- //STATUS1 Register\n- // end of frame event --either end of tx .\n- if (((irq_status1 & RFCORE_SFR_RFIRQF1_TXDONE) == RFCORE_SFR_RFIRQF1_TXDONE)) {\n- // change state\n- radio_vars.state = RADIOSTATE_TXRX_DONE;\n- if (radio_vars.endFrame_cb!=NULL) {\n- // call the callback\n- radio_vars.endFrame_cb(capturedTime);\n- debugpins_isr_clr();\n- // kick the OS\n- return;\n- } else {\n- while(1);\n- }\n- }\n- debugpins_isr_clr();\n-\n- return;\n-}\n-\n-void radio_error_isr(void){\n- uint8_t rferrm;\n-\n- rferrm = (uint8_t)HWREG(RFCORE_XREG_RFERRM);\n-\n- if ((HWREG(RFCORE_XREG_RFERRM) & (((0x02)<<RFCORE_XREG_RFERRM_RFERRM_S)&RFCORE_XREG_RFERRM_RFERRM_M)) & ((uint32_t)rferrm))\n- {\n- HWREG(RFCORE_XREG_RFERRM) = ~(((0x02)<<RFCORE_XREG_RFERRM_RFERRM_S)&RFCORE_XREG_RFERRM_RFERRM_M);\n- //poipoi -- todo handle error\n- }\n-}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. remove the radio.c file for subghz port.
|
491,595 |
25.09.2018 15:02:13
| -7,200 |
ea64d0e3971e2e844a469ea91a30a883e5a00274
|
update the projects.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/01bsp_radio_rx/01bsp_radio_rx.ewp",
"new_path": "projects/openmote-b-subghz/01bsp_radio_rx/01bsp_radio_rx.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_iar.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\board.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\bsp_timer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\crypto_engine.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radiotimer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sctimer.h</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/01bsp_radio_tx/01bsp_radio_tx.ewp",
"new_path": "projects/openmote-b-subghz/01bsp_radio_tx/01bsp_radio_tx.ewp",
"diff": "<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\max44009\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\sht21\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\si70x\\</state>\n+ <state>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\kernel\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\drivers\\common\\</state>\n<state>$PROJ_DIR$\\..\\..\\..\\inc\\</state>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_iar.c</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/01bsp_sctimer/01bsp_sctimer.ewp",
"new_path": "projects/openmote-b-subghz/01bsp_sctimer/01bsp_sctimer.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_iar.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\board.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\bsp_timer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\crypto_engine.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radiotimer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sctimer.h</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/02drv_opentimers/02drv_opentimers.ewp",
"new_path": "projects/openmote-b-subghz/02drv_opentimers/02drv_opentimers.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\board_info.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\bsp_timer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\cc2538rf.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radiotimer.c</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_iar.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\board.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\bsp_timer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\crypto_engine.h</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radiotimer.h</name>\n- <excluded>\n- <configuration>Debug</configuration>\n- </excluded>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sctimer.h</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp",
"new_path": "projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\leds.c</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sensors.c</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\startup_gcc.c</name>\n<excluded>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/03oos_sniffer/03oos_sniffer.ewp",
"new_path": "projects/openmote-b-subghz/03oos_sniffer/03oos_sniffer.ewp",
"diff": "<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\leds.h</name>\n</file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\radio.c</name>\n- </file>\n- <file>\n- <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\radio.h</name>\n- </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\sctimer.c</name>\n</file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\sensors.h</name>\n</file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\openmote-b-subghz\\spi.c</name>\n+ </file>\n<file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\boards\\spi.h</name>\n</file>\n<name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\adxl346\\adxl346.h</name>\n</file>\n</group>\n+ <group>\n+ <name>at86rf215</name>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\at86rf215.h</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.c</name>\n+ </file>\n+ <file>\n+ <name>$PROJ_DIR$\\..\\..\\..\\bsp\\chips\\at86rf215\\radio.h</name>\n+ </file>\n+ </group>\n<group>\n<name>max44009</name>\n<file>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. update the projects.
|
491,595 |
25.09.2018 15:33:27
| -7,200 |
04c022aaf1cb8684ce3ad82184cb7161b87df1fe
|
use maximum txpower for cc2538 radio.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/cc2538rf.h",
"new_path": "bsp/boards/openmote-b-subghz/cc2538rf.h",
"diff": "*---------------------------------------------------------------------------*/\n/* Constants */\n#define CC2538_RF_CCA_THRES_USER_GUIDE 0xF8\n-#define CC2538_RF_TX_POWER_RECOMMENDED 0xD5 /* TODO: Check value */\n+/** Tx Power register\n+ dbm - value\n+{ 7, 0xFF },\n+{ 5, 0xED },\n+{ 3, 0xD5 },\n+{ 1, 0xC5 },\n+{ 0, 0xB6 },\n+{ -1, 0xB0 },\n+{ -3, 0xA1 },\n+{ -5, 0x91 },\n+{ -7, 0x88 },\n+{ -9, 0x72 },\n+{-11, 0x62 },\n+{-13, 0x58 },\n+{-15, 0x42 },\n+{-24, 0x00 },\n+*/\n+#define CC2538_RF_TX_POWER_RECOMMENDED 0xFF // use 7dbm maxmium txpower\n#define CC2538_RF_CHANNEL_MIN 11 // poipoi -- in fact is sending on 0x17 check that.\n#define CC2538_RF_CHANNEL_MAX 26\n#define CC2538_RF_CHANNEL_SPACING 5\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. use maximum txpower for cc2538 radio.
|
491,595 |
25.09.2018 15:48:36
| -7,200 |
a278c42a72b151e6b3731801548e76632df1eaf5
|
initialize spi at beginning of radio_init function.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -81,6 +81,8 @@ void radio_init(void) {\n//power it on and configure pins\nradio_powerOn();\n+ spi_init();\n+\n// clear variables\nmemset(&radio_vars,0,sizeof(radio_vars_t));\n@@ -180,7 +182,7 @@ void radio_rfOff(void) {\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\n// wiggle debug pin\ndebugpins_radio_clr();\n- leds_debug_off();\n+ leds_radio_off();\n// change state\nradio_vars.state = RADIOSTATE_RFOFF;\n@@ -208,7 +210,7 @@ void radio_txEnable(void) {\nat86rf215_spiStrobe(CMD_RF_TXPREP);\n// wiggle debug pin\ndebugpins_radio_set();\n- leds_debug_on();\n+ leds_radio_on();\n}\nvoid radio_txNow(void) {\n@@ -241,7 +243,7 @@ void radio_rxEnable(void) {\nradio_vars.state = RADIOSTATE_ENABLING_RX;\n// wiggle debug pin\ndebugpins_radio_set();\n- leds_debug_on();\n+ leds_radio_on();\nat86rf215_spiStrobe(CMD_RF_RX);\n// change state\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. initialize spi at beginning of radio_init function.
|
491,595 |
25.09.2018 17:23:38
| -7,200 |
be68e3f1c10680029779e64401fef6d783cba6c3
|
configure at86rf215 radio to use fsk option 1.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "//=========================== defines =========================================\n+#define DEFAULT_CHANNEL_SPACING_FSK_OPTION_1 200 // kHz\n+#define DEFAULT_CENTER_FREQUENCY_0_FSK_OPTION_1 863125 // Hz\n+\n//=========================== variables =======================================\ntypedef struct {\n@@ -157,9 +160,11 @@ void radio_setEndFrameCb(radio_capture_cbt cb) {\n//channel spacing in KHz\n//frequency_0 in kHz\n//frequency_nb integer\n-void radio_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel) {\n- frequency_0 = (frequency_0/25);\n- at86rf215_spiWriteReg(RG_RF09_CS, (uint8_t)(channel_spacing/25));\n+void radio_setFrequency(uint16_t channel) {\n+ uint16_t frequency_0;\n+\n+ frequency_0 = (DEFAULT_CENTER_FREQUENCY_0_FSK_OPTION_1/25);\n+ at86rf215_spiWriteReg(RG_RF09_CS, (uint8_t)(DEFAULT_CHANNEL_SPACING_FSK_OPTION_1/25));\nat86rf215_spiWriteReg(RG_RF09_CCF0L, (uint8_t)(frequency_0%256));\nat86rf215_spiWriteReg(RG_RF09_CCF0H, (uint8_t)(frequency_0/256));\nat86rf215_spiWriteReg(RG_RF09_CNL, (uint8_t)(channel%256));\n@@ -208,6 +213,10 @@ void radio_txEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\nat86rf215_spiStrobe(CMD_RF_TXPREP);\n+\n+ // check radio state transit to TRX PREPARE\n+ while (radio_vars.state != RADIOSTATE_TX_ENABLED);\n+\n// wiggle debug pin\ndebugpins_radio_set();\nleds_radio_on();\n@@ -217,12 +226,6 @@ void radio_txNow(void) {\nPORT_TIMER_WIDTH capturedTime;\n- // check radio state transit to TRX PREPARE\n- if (radio_vars.state != RADIOSTATE_TX_ENABLED){\n- // return directly\n- return;\n- }\n-\n// change state\nradio_vars.state = RADIOSTATE_TRANSMITTING;\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.h",
"new_path": "bsp/chips/at86rf215/radio.h",
"diff": "@@ -63,7 +63,7 @@ void radio_setEndFrameCb(radio_capture_cbt cb);\n// reset\nvoid radio_reset(void);\n// RF admin\n-void radio_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel);\n+void radio_setFrequency(uint16_t channel);\nvoid radio_rfOn(void);\nvoid radio_rfOff(void);\nvoid radio_change_modulation(registerSetting_t * mod);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -72,9 +72,9 @@ len=17 num=84 rssi=-81 lqi=108 crc=1\n//=========================== defines =========================================\n-#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes\n-#define CHANNEL 16 ///< 11 = 2.405GHz\n-#define LENGTH_SERIAL_FRAME 8 ///< length of the serial frame\n+#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n+#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n+#define LENGTH_SERIAL_FRAME 8 // length of the serial frame\n//=========================== variables =======================================\n@@ -191,7 +191,7 @@ int mote_main(void) {\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n- leds_debug_on();\n+ leds_sync_on();\n// update debug stats\napp_dbg.num_startFrame++;\n}\n@@ -203,8 +203,6 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// indicate I just received a packet\napp_vars.rxpk_done = 1;\n- leds_sync_on();\n-\n// get packet from radio\nradio_getReceivedFrame(\napp_vars.rxpk_buf,\n@@ -215,6 +213,10 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n&app_vars.rxpk_crc\n);\n+ // keep listening (needed for at86rf215 radio)\n+ radio_rxEnable();\n+ radio_rxNow();\n+\n// read the packet number\napp_vars.rxpk_num = app_vars.rxpk_buf[0];\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -22,7 +22,7 @@ remainder of the packet contains an incrementing bytes.\n//=========================== defines =========================================\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n-#define CHANNEL 16 // 11 = 2.405GHz\n+#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n#define TIMER_PERIOD (32768>>1) // (32768>>1) = 500ms @ 32kHz\n//=========================== variables =======================================\n@@ -88,6 +88,7 @@ int mote_main(void) {\nboard_sleep();\n}\nradio_setFrequency(CHANNEL);\n+ radio_rfOff();\n// led\nleds_error_toggle();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/01bsp_radio_tx/01bsp_radio_tx.ewd",
"new_path": "projects/openmote-b-subghz/01bsp_radio_tx/01bsp_radio_tx.ewd",
"diff": "</option>\n<option>\n<name>OCDynDriverList</name>\n- <state>XDS100_ID</state>\n+ <state>JLINK_ID</state>\n</option>\n<option>\n<name>OCLastSavedByProductVersion</name>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. configure at86rf215 radio to use fsk option 1.
|
491,595 |
26.09.2018 11:31:45
| -7,200 |
d0f195b0d412f9bae90618107449917273fc2fa3
|
check the received frame is sent by bsp_radio_tx.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -150,7 +150,6 @@ int mote_main(void) {\nwhile (app_vars.rxpk_done==0) {\nboard_sleep();\n}\n- leds_debug_off();\n// if I get here, I just received a packet\n@@ -197,6 +196,8 @@ void cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n}\nvoid cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n+ uint8_t i;\n+ bool expectedFrame;\n// update debug stats\napp_dbg.num_endFrame++;\n@@ -220,6 +221,20 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// read the packet number\napp_vars.rxpk_num = app_vars.rxpk_buf[0];\n+ // check the frame is sent by radio_tx project\n+ expectedFrame = TRUE;\n+ for(i=1;i<10;i++){\n+ if(app_vars.rxpk_buf[i]!=i){\n+ expectedFrame = FALSE;\n+ break;\n+ }\n+ }\n+\n+ // toggle led if the frame is expected\n+ if (expectedFrame){\n+ leds_debug_toggle();\n+ }\n+\n// led\nleds_sync_off();\n}\n@@ -244,7 +259,4 @@ void cb_uartRxCb(void) {\n// uint8_t byte;\nuart_clearRxInterrupts();\n-\n- // toggle LED\n- leds_debug_toggle();\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. check the received frame is sent by bsp_radio_tx.
|
491,594 |
28.09.2018 16:58:58
| -7,200 |
b1beafea17ba1792626824b57e9c522d5a40a637
|
prints PDR over serial port.
IFS is 100'000 machine cycles.
packet length, 20 B.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -210,6 +210,7 @@ radio_state_t radio_getState(void){\nvoid radio_txEnable(void) {\n+ //if (!at86rf215_status() & IRQS_TRXRDY_MASK){\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\nat86rf215_spiStrobe(CMD_RF_TXPREP);\n@@ -220,6 +221,7 @@ void radio_txEnable(void) {\n// wiggle debug pin\ndebugpins_radio_set();\nleds_radio_on();\n+ //}\n}\nvoid radio_txNow(void) {\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -94,6 +94,8 @@ typedef struct {\nuint8_t rxpk_num;\nint8_t rxpk_rssi;\nuint8_t rxpk_lqi;\n+ uint8_t rxpk_previous;\n+ uint8_t rxpk_counter;\nbool rxpk_crc;\n// uart\nuint8_t uart_txFrame[LENGTH_SERIAL_FRAME];\n@@ -124,6 +126,10 @@ int mote_main(void) {\n// clear local variables\nmemset(&app_vars,0,sizeof(app_vars_t));\n+ app_vars.rxpk_previous = 0;\n+ app_vars.rxpk_counter = 0;\n+ app_vars.rxpk_lqi = 0;\n+\n// initialize board\nboard_init();\n@@ -142,6 +148,7 @@ int mote_main(void) {\nradio_rxEnable();\nradio_rxNow();\n+\nwhile (1) {\n// sleep while waiting for at least one of the rxpk_done to be set\n@@ -157,9 +164,21 @@ int mote_main(void) {\n// led\nleds_error_on();\n+ app_vars.rxpk_counter++;\n+ if (!(app_vars.rxpk_previous < app_vars.rxpk_num)) {\n+ app_vars.rxpk_lqi = 1;\n+ }\n+ app_vars.rxpk_previous = app_vars.rxpk_num;\n+ //if (app_vars.rxpk_previous < app_vars.rxpk_num) {\n+ // app_vars.rxpk_previous = app_vars.rxpk_num;\n+ //}\n+ //else {\n+ // app_vars.rxpk_previous = app_vars.rxpk_num;\n+ // app_vars.rxpk_lqi = 1;\n+ //}\n// format frame to send over serial port\n- app_vars.uart_txFrame[0] = app_vars.rxpk_len; // packet length\n+ app_vars.uart_txFrame[0] = app_vars.rxpk_counter; // packet counter\napp_vars.uart_txFrame[1] = app_vars.rxpk_num; // packet number\napp_vars.uart_txFrame[2] = app_vars.rxpk_rssi; // RSSI\napp_vars.uart_txFrame[3] = app_vars.rxpk_lqi; // LQI\n@@ -171,6 +190,7 @@ int mote_main(void) {\napp_vars.uart_done = 0;\napp_vars.uart_lastTxByte = 0;\n+ if (app_vars.rxpk_lqi == 1){\n// send app_vars.uart_txFrame over UART\nuart_clearTxInterrupts();\nuart_clearRxInterrupts();\n@@ -178,7 +198,9 @@ int mote_main(void) {\nuart_writeByte(app_vars.uart_txFrame[app_vars.uart_lastTxByte]);\nwhile (app_vars.uart_done==0); // busy wait to finish\nuart_disableInterrupts();\n-\n+ app_vars.rxpk_lqi = 0;\n+ app_vars.rxpk_counter = 0;\n+ }\n// led\nleds_error_off();\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.py",
"diff": "@@ -79,7 +79,7 @@ while True:\n(rxpk_len,rxpk_num,rxpk_rssi,rxpk_lqi,rxpk_crc) = \\\nstruct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame[-8:-3]]))\n- print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n+ print 'PDR={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\nrxpk_len,\nrxpk_num,\nrxpk_rssi,\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -21,9 +21,9 @@ remainder of the packet contains an incrementing bytes.\n//=========================== defines =========================================\n-#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n+#define LENGTH_PACKET 18+LENGTH_CRC // maximum length is 127 bytes\n#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n-#define TIMER_PERIOD (32768>>1) // (32768>>1) = 500ms @ 32kHz\n+#define TIMER_PERIOD (32768>>6) // (32768>>1) = 500ms @ 32kHz\n//=========================== variables =======================================\n@@ -59,6 +59,7 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp);\n*/\nint mote_main(void) {\nuint8_t i;\n+ uint32_t j;\n// clear local variables\nmemset(&app_vars,0,sizeof(app_vars_t));\n@@ -77,23 +78,24 @@ int mote_main(void) {\nradio_rfOff();\n// start periodic overflow\n- sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n- sctimer_enable();\n-\n+ //sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n+ //sctimer_enable();\n+ app_vars.txpk_num = 0;\nwhile(1) {\n// wait for timer to elapse\n- app_vars.txpk_txNow = 0;\n- while (app_vars.txpk_txNow==0) {\n- board_sleep();\n- }\n- radio_setFrequency(CHANNEL);\n+ //app_vars.txpk_txNow = 1;\n+ //while (app_vars.txpk_txNow==0) {\n+ // board_sleep();\n+ //}\n+ //radio_setFrequency(CHANNEL);\nradio_rfOff();\n// led\nleds_error_toggle();\n// prepare packet\napp_vars.txpk_num++;\n+\napp_vars.txpk_len = sizeof(app_vars.txpk_buf);\napp_vars.txpk_buf[0] = app_vars.txpk_num;\nfor (i=1;i<app_vars.txpk_len;i++) {\n@@ -104,6 +106,13 @@ int mote_main(void) {\nradio_loadPacket(app_vars.txpk_buf,app_vars.txpk_len);\nradio_txEnable();\nradio_txNow();\n+ for (j=0;j<100000;j++) {\n+ j++;\n+ }\n+ // reset the counter\n+ if (app_vars.txpk_num == 100){\n+ app_vars.txpk_num = 0;\n+ }\n}\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
prints PDR over serial port.
IFS is 100'000 machine cycles.
packet length, 20 B.
|
491,594 |
28.09.2018 18:51:14
| -7,200 |
ce0dadbd9290b885417cd4cfb11c764e807e7e49
|
sub-ghz PDR test
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3985,25 +3985,26 @@ static const registerSetting_t basic_settings_fsk_option1 []={\n{RG_RF09_IRQM, 0x1F}, // TRXERR, BATLOW, EDC, TRXRDY, WAKEUP interrupts enabled\n{RG_RF24_IRQM, 0x00},\n{RG_RF09_RXBWC, 0x00},\n- {RG_RF09_RXDFE, 0x1A},\n+ {RG_RF09_RXDFE, 0x2A}, // RCUT = 1 , SR = 10\n{RG_RF09_AGCC, 0x01},\n+ {RG_RF09_AGCS, 0x37},\n{RG_RF09_EDD, 0x7A},\n{RG_RF09_TXCUTC, 0xC0},\n{RG_RF09_TXDFE, 0x98},\n- {RG_RF09_PAC, 0x1F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n+ {RG_RF09_PAC, 0x7F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n{RG_BBC0_IRQM, 0x1F},// TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled\n{RG_BBC1_IRQM, 0x00},\n- {RG_BBC0_PC, 0x1D},// No FCS filter, 32 bits FCS, FSK.\n+ {RG_BBC0_PC, 0x15},// No FCS filter, 16 bits FCS, FSK.\n{RG_BBC0_FSKDM, 0x01},//Direct modulation and preemphasis enabled.\n{RG_BBC0_FSKC0, 0xD6},\n{RG_BBC0_FSKC1, 0x00},\n- {RG_BBC0_FSKC2, 0x40},\n+ //{RG_BBC0_FSKC2, 0x40},\n{RG_BBC0_FSKC3, 0x85},\n- {RG_BBC0_FSKC4, 0x0A}, //FEC enabled. IEEE MODE\n- {RG_BBC0_FSKPE0, 0x74},\n- {RG_BBC0_FSKPE1, 0x7F},\n- {RG_BBC0_FSKPE2, 0x80},\n- {RG_BBC0_FSKPHRTX, 0x00},// No data whitening SFD0 used.\n+ {RG_BBC0_FSKC4, 0x00}, //FEC disabled. IEEE MODE\n+ {RG_BBC0_FSKPE0, 0x02},\n+ {RG_BBC0_FSKPE1, 0x03},\n+ {RG_BBC0_FSKPE2, 0xFC},\n+ {RG_BBC0_FSKPHRTX, 0x08},// No data whitening SFD0 used.\n};\nstatic const registerSetting_t basic_settings_fsk_option2 []={\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -167,16 +167,6 @@ int mote_main(void) {\napp_vars.rxpk_counter++;\nif (!(app_vars.rxpk_previous < app_vars.rxpk_num)) {\napp_vars.rxpk_lqi = 1;\n- }\n- app_vars.rxpk_previous = app_vars.rxpk_num;\n- //if (app_vars.rxpk_previous < app_vars.rxpk_num) {\n- // app_vars.rxpk_previous = app_vars.rxpk_num;\n- //}\n- //else {\n- // app_vars.rxpk_previous = app_vars.rxpk_num;\n- // app_vars.rxpk_lqi = 1;\n- //}\n-\n// format frame to send over serial port\napp_vars.uart_txFrame[0] = app_vars.rxpk_counter; // packet counter\napp_vars.uart_txFrame[1] = app_vars.rxpk_num; // packet number\n@@ -186,11 +176,19 @@ int mote_main(void) {\napp_vars.uart_txFrame[5] = 0xff; // closing flag\napp_vars.uart_txFrame[6] = 0xff; // closing flag\napp_vars.uart_txFrame[7] = 0xff; // closing flag\n+ }\n+ app_vars.rxpk_previous = app_vars.rxpk_num;\n+ //if (app_vars.rxpk_previous < app_vars.rxpk_num) {\n+ // app_vars.rxpk_previous = app_vars.rxpk_num;\n+ //}\n+ //else {\n+ // app_vars.rxpk_previous = app_vars.rxpk_num;\n+ // app_vars.rxpk_lqi = 1;\n+ //}\n+ if (app_vars.rxpk_lqi == 1){\napp_vars.uart_done = 0;\napp_vars.uart_lastTxByte = 0;\n-\n- if (app_vars.rxpk_lqi == 1){\n// send app_vars.uart_txFrame over UART\nuart_clearTxInterrupts();\nuart_clearRxInterrupts();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -106,7 +106,7 @@ int mote_main(void) {\nradio_loadPacket(app_vars.txpk_buf,app_vars.txpk_len);\nradio_txEnable();\nradio_txNow();\n- for (j=0;j<100000;j++) {\n+ for (j=0;j<150000;j++) {\nj++;\n}\n// reset the counter\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
sub-ghz PDR test
|
491,594 |
01.10.2018 09:43:42
| -7,200 |
a67bcca3001996dee6b008a1476c1c39b09fd88d
|
radio rx sends packet counter after at least 100 packets received.
radio tx does not set frequency before each packet previous to tx.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -97,6 +97,7 @@ typedef struct {\nuint8_t rxpk_previous;\nuint8_t rxpk_counter;\nbool rxpk_crc;\n+ bool rxpk_send_uart;\n// uart\nuint8_t uart_txFrame[LENGTH_SERIAL_FRAME];\nuint8_t uart_lastTxByte;\n@@ -128,7 +129,7 @@ int mote_main(void) {\napp_vars.rxpk_previous = 0;\napp_vars.rxpk_counter = 0;\n- app_vars.rxpk_lqi = 0;\n+ app_vars.rxpk_send_uart = FALSE;\n// initialize board\nboard_init();\n@@ -166,7 +167,7 @@ int mote_main(void) {\nleds_error_on();\napp_vars.rxpk_counter++;\nif (!(app_vars.rxpk_previous < app_vars.rxpk_num)) {\n- app_vars.rxpk_lqi = 1;\n+ app_vars.rxpk_send_uart = TRUE;\n// format frame to send over serial port\napp_vars.uart_txFrame[0] = app_vars.rxpk_counter; // packet counter\napp_vars.uart_txFrame[1] = app_vars.rxpk_num; // packet number\n@@ -177,16 +178,10 @@ int mote_main(void) {\napp_vars.uart_txFrame[6] = 0xff; // closing flag\napp_vars.uart_txFrame[7] = 0xff; // closing flag\n}\n+\napp_vars.rxpk_previous = app_vars.rxpk_num;\n- //if (app_vars.rxpk_previous < app_vars.rxpk_num) {\n- // app_vars.rxpk_previous = app_vars.rxpk_num;\n- //}\n- //else {\n- // app_vars.rxpk_previous = app_vars.rxpk_num;\n- // app_vars.rxpk_lqi = 1;\n- //}\n-\n- if (app_vars.rxpk_lqi == 1){\n+\n+ if (app_vars.rxpk_send_uart){\napp_vars.uart_done = 0;\napp_vars.uart_lastTxByte = 0;\n// send app_vars.uart_txFrame over UART\n@@ -196,8 +191,8 @@ int mote_main(void) {\nuart_writeByte(app_vars.uart_txFrame[app_vars.uart_lastTxByte]);\nwhile (app_vars.uart_done==0); // busy wait to finish\nuart_disableInterrupts();\n- app_vars.rxpk_lqi = 0;\napp_vars.rxpk_counter = 0;\n+ app_vars.rxpk_send_uart = FALSE;\n}\n// led\nleds_error_off();\n@@ -221,8 +216,6 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// update debug stats\napp_dbg.num_endFrame++;\n- // indicate I just received a packet\n- app_vars.rxpk_done = 1;\n// get packet from radio\nradio_getReceivedFrame(\n@@ -234,22 +227,27 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n&app_vars.rxpk_crc\n);\n- // keep listening (needed for at86rf215 radio)\n- radio_rxEnable();\n- radio_rxNow();\n-\n- // read the packet number\n- app_vars.rxpk_num = app_vars.rxpk_buf[0];\n-\n// check the frame is sent by radio_tx project\nexpectedFrame = TRUE;\nfor(i=1;i<10;i++){\nif(app_vars.rxpk_buf[i]!=i){\nexpectedFrame = FALSE;\nbreak;\n+ } else {\n+ // indicate I just received a packet\n+ app_vars.rxpk_done = 1;\n}\n}\n+ // keep listening (needed for at86rf215 radio)\n+ radio_rxEnable();\n+ radio_rxNow();\n+\n+ // read the packet number\n+ app_vars.rxpk_num = app_vars.rxpk_buf[0];\n+\n+\n+\n// toggle led if the frame is expected\nif (expectedFrame){\nleds_debug_toggle();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -88,7 +88,7 @@ int mote_main(void) {\n//while (app_vars.txpk_txNow==0) {\n// board_sleep();\n//}\n- //radio_setFrequency(CHANNEL);\n+ radio_setFrequency(CHANNEL);\nradio_rfOff();\n// led\nleds_error_toggle();\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-24ghz/01bsp_radio_tx/01bsp_radio_tx.ewd",
"new_path": "projects/openmote-b-24ghz/01bsp_radio_tx/01bsp_radio_tx.ewd",
"diff": "<name>C-SPY</name>\n<archiveVersion>2</archiveVersion>\n<data>\n- <version>28</version>\n+ <version>29</version>\n<wantNonLocal>1</wantNonLocal>\n<debug>1</debug>\n<option>\n</option>\n<option>\n<name>OCDynDriverList</name>\n- <state>XDS100_ID</state>\n+ <state>JLINK_ID</state>\n</option>\n<option>\n<name>OCLastSavedByProductVersion</name>\n- <state>8.11.1.13270</state>\n+ <state>8.20.1.14181</state>\n</option>\n<option>\n<name>UseFlashLoader</name>\n<name>OCAttachSlave</name>\n<state>0</state>\n</option>\n+ <option>\n+ <name>MassEraseBeforeFlashing</name>\n+ <state>0</state>\n+ </option>\n</data>\n</settings>\n<settings>\n<file>$TOOLKIT_DIR$\\plugins\\rtos\\embOS\\embOSPlugin.ewplugin</file>\n<loadFlag>0</loadFlag>\n</plugin>\n+ <plugin>\n+ <file>$TOOLKIT_DIR$\\plugins\\rtos\\Mbed\\MbedArmPlugin.ENU.ewplugin</file>\n+ <loadFlag>0</loadFlag>\n+ </plugin>\n<plugin>\n<file>$TOOLKIT_DIR$\\plugins\\rtos\\OpenRTOS\\OpenRTOSPlugin.ewplugin</file>\n<loadFlag>0</loadFlag>\n<file>$EW_DIR$\\common\\plugins\\Orti\\Orti.ENU.ewplugin</file>\n<loadFlag>0</loadFlag>\n</plugin>\n+ <plugin>\n+ <file>$EW_DIR$\\common\\plugins\\TargetAccessServer\\TargetAccessServer.ENU.ewplugin</file>\n+ <loadFlag>0</loadFlag>\n+ </plugin>\n<plugin>\n<file>$EW_DIR$\\common\\plugins\\uCProbe\\uCProbePlugin.ENU.ewplugin</file>\n<loadFlag>0</loadFlag>\n<name>C-SPY</name>\n<archiveVersion>2</archiveVersion>\n<data>\n- <version>28</version>\n+ <version>29</version>\n<wantNonLocal>1</wantNonLocal>\n<debug>0</debug>\n<option>\n<name>OCAttachSlave</name>\n<state>0</state>\n</option>\n+ <option>\n+ <name>MassEraseBeforeFlashing</name>\n+ <state>0</state>\n+ </option>\n</data>\n</settings>\n<settings>\n<file>$TOOLKIT_DIR$\\plugins\\rtos\\embOS\\embOSPlugin.ewplugin</file>\n<loadFlag>0</loadFlag>\n</plugin>\n+ <plugin>\n+ <file>$TOOLKIT_DIR$\\plugins\\rtos\\Mbed\\MbedArmPlugin.ENU.ewplugin</file>\n+ <loadFlag>0</loadFlag>\n+ </plugin>\n<plugin>\n<file>$TOOLKIT_DIR$\\plugins\\rtos\\OpenRTOS\\OpenRTOSPlugin.ewplugin</file>\n<loadFlag>0</loadFlag>\n<file>$EW_DIR$\\common\\plugins\\Orti\\Orti.ENU.ewplugin</file>\n<loadFlag>0</loadFlag>\n</plugin>\n+ <plugin>\n+ <file>$EW_DIR$\\common\\plugins\\TargetAccessServer\\TargetAccessServer.ENU.ewplugin</file>\n+ <loadFlag>0</loadFlag>\n+ </plugin>\n<plugin>\n<file>$EW_DIR$\\common\\plugins\\uCProbe\\uCProbePlugin.ENU.ewplugin</file>\n<loadFlag>0</loadFlag>\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
radio rx sends packet counter after at least 100 packets received.
radio tx does not set frequency before each packet previous to tx.
|
491,595 |
01.10.2018 11:29:29
| -7,200 |
5f9ae9120abd57ddd34cdd81584fa4f88eab52be
|
update bsp_radio_tx project.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -21,15 +21,15 @@ remainder of the packet contains an incrementing bytes.\n//=========================== defines =========================================\n-#define LENGTH_PACKET 18+LENGTH_CRC // maximum length is 127 bytes\n+#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n-#define TIMER_PERIOD (32768>>6) // (32768>>1) = 500ms @ 32kHz\n+#define TIMER_PERIOD (32768>>5) // (32768>>1) = 500ms @ 32kHz\n+#define SN_OVERFLOW 100 // sequence number resets to 0 when hit SN_OVERFLOW\n//=========================== variables =======================================\ntypedef struct {\n- uint8_t num_radioTimerCompare;\n- uint8_t num_radioTimerOverflows;\n+ uint8_t num_scTimerCompare;\nuint8_t num_startFrame;\nuint8_t num_endFrame;\n} app_dbg_t;\n@@ -47,8 +47,7 @@ app_vars_t app_vars;\n//=========================== prototypes ======================================\n-void cb_radioTimerOverflows(void);\n-void cb_radioTimerCompare(void);\n+void cb_scTimerCompare(void);\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp);\nvoid cb_endFrame(PORT_TIMER_WIDTH timestamp);\n@@ -59,7 +58,6 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp);\n*/\nint mote_main(void) {\nuint8_t i;\n- uint32_t j;\n// clear local variables\nmemset(&app_vars,0,sizeof(app_vars_t));\n@@ -68,7 +66,7 @@ int mote_main(void) {\nboard_init();\n// add radio callback functions\n- sctimer_set_callback(cb_radioTimerOverflows);\n+ sctimer_set_callback(cb_scTimerCompare);\nradio_setStartFrameCb(cb_startFrame);\nradio_setEndFrameCb(cb_endFrame);\n@@ -78,16 +76,16 @@ int mote_main(void) {\nradio_rfOff();\n// start periodic overflow\n- //sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n- //sctimer_enable();\n+ sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n+ sctimer_enable();\napp_vars.txpk_num = 0;\nwhile(1) {\n// wait for timer to elapse\n- //app_vars.txpk_txNow = 1;\n- //while (app_vars.txpk_txNow==0) {\n- // board_sleep();\n- //}\n+ app_vars.txpk_txNow = 1;\n+ while (app_vars.txpk_txNow==0) {\n+ board_sleep();\n+ }\nradio_setFrequency(CHANNEL);\nradio_rfOff();\n// led\n@@ -106,11 +104,9 @@ int mote_main(void) {\nradio_loadPacket(app_vars.txpk_buf,app_vars.txpk_len);\nradio_txEnable();\nradio_txNow();\n- for (j=0;j<150000;j++) {\n- j++;\n- }\n- // reset the counter\n- if (app_vars.txpk_num == 100){\n+\n+ // reset the sequence number\n+ if (app_vars.txpk_num == SN_OVERFLOW){\napp_vars.txpk_num = 0;\n}\n}\n@@ -118,21 +114,14 @@ int mote_main(void) {\n//=========================== callbacks =======================================\n-void cb_radioTimerCompare(void) {\n+void cb_scTimerCompare(void) {\n// update debug vals\n- app_dbg.num_radioTimerCompare++;\n-}\n-\n-void cb_radioTimerOverflows(void) {\n-\n- // update debug vals\n- app_dbg.num_radioTimerOverflows++;\n+ app_dbg.num_scTimerCompare++;\n// ready to send next packet\napp_vars.txpk_txNow = 1;\n// schedule again\nsctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD);\n-\n}\nvoid cb_startFrame(PORT_TIMER_WIDTH timestamp) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
update bsp_radio_tx project.
|
491,595 |
02.10.2018 17:39:38
| -7,200 |
2ac6c8cb7243de1c35c4d82f6c80949045e61b8d
|
update bsp_radio_rx and tx projects.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"new_path": "projects/common/01bsp_radio_rx/01bsp_radio_rx.c",
"diff": "@@ -202,6 +202,8 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {\n// update debug stats\napp_dbg.num_endFrame++;\n+ memset(&app_vars.rxpk_buf[0],0,LENGTH_PACKET);\n+\n// get packet from radio\nradio_getReceivedFrame(\napp_vars.rxpk_buf,\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -23,7 +23,7 @@ remainder of the packet contains an incrementing bytes.\n#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes\n#define CHANNEL 16 // 24ghz: 11 = 2.405GHz, subghz: 0 = 863.125 in FSK operating mode #1\n-#define TIMER_PERIOD (32768>>5) // (32768>>1) = 500ms @ 32kHz\n+#define TIMER_PERIOD (32768>>4) // (32768>>1) = 500ms @ 32kHz\n#define SN_OVERFLOW 100 // sequence number resets to 0 when hit SN_OVERFLOW\n//=========================== variables =======================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. update bsp_radio_rx and tx projects.
|
491,595 |
02.10.2018 17:51:02
| -7,200 |
e4c700da1438f6e85ba39a3ffd34a1aa578e2f4a
|
comment out the debug info and update key name.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_rx/opentestbed_pdr.py",
"new_path": "projects/common/01bsp_radio_rx/opentestbed_pdr.py",
"diff": "@@ -13,6 +13,10 @@ BROKER_ADDRESS = \"argus.paris.inria.fr\"\nBSP_RADIO_TX_IHEX = '01bsp_radio_tx_prog-subghz.ihex'\nBSP_RADIO_RX_IHEX = '01bsp_radio_rx_prog-subghz.ihex'\n+# BSP_RADIO_TX_IHEX = '01bsp_radio_tx_prog-24ghz.ihex'\n+# BSP_RADIO_RX_IHEX = '01bsp_radio_rx_prog-24ghz.ihex'\n+\n+\n#============================ class ===========================================\nclass mqtt_client(object):\n@@ -50,9 +54,9 @@ class mqtt_client(object):\nself.motes_pdr[mote]['previousFrame'] = 0\nself.motes_pdr[mote]['frameCounter'] = 0\nself.motes_pdr[mote]['pdr'] = 0\n- self.motes_pdr[mote]['frameCounter_overflow'] = False\n+ self.motes_pdr[mote]['rxpk_num_overflow'] = False\n- print self.motes_pdr\n+ # print self.motes_pdr\nself.mqtt_topic_cmd = 'opentestbed/deviceType/{0}/deviceId/{1}/cmd/{2}'.format(self.deviceType, self.deviceId , self.cmd)\nif self.deviceId == 'all':\n@@ -157,25 +161,28 @@ class mqtt_client(object):\nif serialbytes[i]==255 and serialbytes[i+1]!=255:\nframeStart = i+1\n+ # parsing the serial bytes\ntry:\nfor rawFrame in rawFrames:\nif len(rawFrame)==5:\nself.motes_pdr[mote_eui64]['frameCounter'] += 1\n(rxpk_len,rxpk_num,rxpk_rssi,rxpk_lqi,rxpk_crc) = \\\nstruct.unpack('>BBbBB', ''.join([chr(b) for b in rawFrame]))\n- print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n- rxpk_len,\n- rxpk_num,\n- rxpk_rssi,\n- rxpk_lqi,\n- rxpk_crc\n- )\n+ # print 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4}'.format(\n+ # rxpk_len,\n+ # rxpk_num,\n+ # rxpk_rssi,\n+ # rxpk_lqi,\n+ # rxpk_crc\n+ # )\nif self.motes_pdr[mote_eui64]['previousFrame']>rxpk_num:\n- if self.motes_pdr[mote_eui64]['frameCounter_overflow']:\n+ # the rxpk_num maybe not start with 1 when the script runs,\n+ # record the pdr when rxpk_num overflow\n+ if self.motes_pdr[mote_eui64]['rxpk_num_overflow']:\nself.motes_pdr[mote_eui64]['pdr'] = self.motes_pdr[mote_eui64]['frameCounter']\nself.motes_pdr[mote_eui64]['previousFrame'] = 0\nself.motes_pdr[mote_eui64]['frameCounter'] = 0\n- self.motes_pdr[mote_eui64]['frameCounter_overflow'] = True\n+ self.motes_pdr[mote_eui64]['rxpk_num_overflow'] = True\nelse:\nself.motes_pdr[mote_eui64]['previousFrame'] = rxpk_num\nexcept ValueError as err:\n@@ -185,10 +192,8 @@ class mqtt_client(object):\nprint \"signle frame {0} at mote {1}\".format(rawFrame, mote_eui64)\nraise\n- print \"receive serial bytes {0} frome mote {1}\".format(message.topic.split('/')[4],serialbytes)\n-\n+ # print \"receive serial bytes {0} frome mote {1}\".format(message.topic.split('/')[4],serialbytes)\n- # self.serialbytes_queue.put(json.loads(message.payload)['serialbytes'])\ndef get_motelist(self):\nreturn self.motelist\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. comment out the debug info and update key name.
|
491,595 |
03.10.2018 13:27:20
| -7,200 |
b63006ca32a5047663eef0e4a2af0089c0f0d538
|
update at87rf215.h file.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/at86rf215.h",
"new_path": "bsp/chips/at86rf215/at86rf215.h",
"diff": "@@ -3991,14 +3991,14 @@ static const registerSetting_t basic_settings_fsk_option1 []={\n{RG_RF09_EDD, 0x7A},\n{RG_RF09_TXCUTC, 0xC0},\n{RG_RF09_TXDFE, 0x98},\n- {RG_RF09_PAC, 0x7F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F.\n+ {RG_RF09_PAC, 0x7F},// 0x7F=> bit6-5(0b11): No power amplifier current reduction (max. transmit small signal gain) bit 4-0(0b11111): maxmium tx power\n{RG_BBC0_IRQM, 0x1F},// TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled\n{RG_BBC1_IRQM, 0x00},\n- {RG_BBC0_PC, 0x15},// No FCS filter, 16 bits FCS, FSK.\n+ {RG_BBC0_PC, 0x1D},// No FCS filter, 32 bits FCS, FSK.\n{RG_BBC0_FSKDM, 0x01},// Direct modulation and preemphasis enabled.\n{RG_BBC0_FSKC0, 0xD6},\n{RG_BBC0_FSKC1, 0x00},\n- //{RG_BBC0_FSKC2, 0x40},\n+ {RG_BBC0_FSKC2, 0x40},\n{RG_BBC0_FSKC3, 0x85},\n{RG_BBC0_FSKC4, 0x00}, //FEC disabled. IEEE MODE\n{RG_BBC0_FSKPE0, 0x02},\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-776. update at87rf215.h file.
|
491,595 |
03.10.2018 14:46:04
| -7,200 |
275876a62ca87d52b9f7b2b0512cde5f51b1d8f5
|
check status before go to next.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -176,7 +176,7 @@ void radio_setFrequency(uint16_t channel) {\nvoid radio_rfOn(void) {\n//put the radio in the TRXPREP state\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\n- //while(radio_vars.state != RADIOSTATE_TX_ENABLED);\n+ while(at86rf215_status() != RF_STATE_TRXOFF);\n}\nvoid radio_rfOff(void) {\n@@ -185,6 +185,7 @@ void radio_rfOff(void) {\nradio_vars.state = RADIOSTATE_TURNING_OFF;\nat86rf215_spiStrobe(CMD_RF_TRXOFF);\n+ while(at86rf215_status() != RF_STATE_TRXOFF);\n// wiggle debug pin\ndebugpins_radio_clr();\nleds_radio_off();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-777. check status before go to next.
|
491,595 |
03.10.2018 17:14:04
| -7,200 |
423bac6da7266f1c28ef02ea1df9492421971bd8
|
make the status is in TRXOFF before updating frequency.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -86,8 +86,6 @@ void radio_init(void) {\nspi_init();\n- at86rf215_status();\n-\n// clear variables\nmemset(&radio_vars,0,sizeof(radio_vars_t));\n@@ -165,6 +163,10 @@ void radio_setEndFrameCb(radio_capture_cbt cb) {\nvoid radio_setFrequency(uint16_t channel) {\nuint16_t frequency_0;\n+ // frequency has to be updated in TRXOFF status (datatsheet: 6.3.2).\n+ at86rf215_spiStrobe(CMD_RF_TRXOFF);\n+ while(at86rf215_status() != RF_STATE_TRXOFF);\n+\nfrequency_0 = (DEFAULT_CENTER_FREQUENCY_0_FSK_OPTION_1/25);\nat86rf215_spiWriteReg(RG_RF09_CS, (uint8_t)(DEFAULT_CHANNEL_SPACING_FSK_OPTION_1/25));\nat86rf215_spiWriteReg(RG_RF09_CCF0L, (uint8_t)(frequency_0%256));\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-777. make the status is in TRXOFF before updating frequency.
|
491,595 |
03.10.2018 18:42:04
| -7,200 |
3aed59671d3602d0fbe76c8f50cb28b72b9a7016
|
only change to txprep status if radio is not in the status.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -43,6 +43,7 @@ typedef struct {\nuint8_t rf24_isr;\nuint8_t bb0_isr;\nuint8_t bb1_isr;\n+ bool trx_ready;\n} radio_vars_t;\nradio_vars_t radio_vars;\n@@ -217,14 +218,19 @@ void radio_txEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n- at86rf215_spiStrobe(CMD_RF_TXPREP);\n- // check radio state transit to TRX PREPARE\n- while (radio_vars.state != RADIOSTATE_TX_ENABLED);\n+ if(at86rf215_status() != RF_STATE_TXPREP){\n+ radio_vars.trx_ready = FALSE;\n+ // change status to TXPREP\n+ at86rf215_spiStrobe(CMD_RF_TXPREP);\n+ while(!radio_vars.trx_ready);\n+ }\n// wiggle debug pin\ndebugpins_radio_set();\nleds_radio_on();\n+\n+ radio_vars.state = RADIOSTATE_TX_ENABLED;\n}\nvoid radio_txNow(void) {\n@@ -312,8 +318,8 @@ void radio_isr(void) {\nradio_read_isr();\nif (radio_vars.rf09_isr & IRQS_TRXRDY_MASK){\n- radio_vars.state = RADIOSTATE_TX_ENABLED;\n- // result = DO_NOT_KICK_SCHEDULER;\n+ // trx_ready\n+ radio_vars.trx_ready = TRUE;\n}\nif (radio_vars.bb0_isr & IRQS_RXFS_MASK){\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"new_path": "projects/common/01bsp_radio_tx/01bsp_radio_tx.c",
"diff": "@@ -86,7 +86,6 @@ int mote_main(void) {\nboard_sleep();\n}\nradio_setFrequency(CHANNEL);\n- radio_rfOff();\n// led\nleds_error_toggle();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-777. only change to txprep status if radio is not in the status.
|
491,595 |
03.10.2018 19:44:45
| -7,200 |
fd0962607dd17a69e154b4ba9b83d0982c641efd
|
add script to get serial bytes.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/00std_selftest/00std_selftest.c",
"new_path": "projects/openmote-b-subghz/00std_selftest/00std_selftest.c",
"diff": "@@ -221,6 +221,7 @@ int main(void) {\npartNumber = at86rf215_spiReadReg(RG_RF_PN);\nversionNumber = at86rf215_spiReadReg(RG_RF_VN);\n+ while(1){\n//==== return the result\nif (partNumber == AT86RF215_PART_NUMBER){\nUARTCharPut(UART0_BASE, 'P');\n@@ -233,6 +234,8 @@ int main(void) {\n} else {\nUARTCharPut(UART0_BASE, 'F');\n}\n+ UARTCharPut(UART0_BASE, ' ');\n+ }\n}\nvoid spi_txrx(uint8_t* bufTx,\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/openmote-b-subghz/00std_selftest/00std_selftest.ewp",
"new_path": "projects/openmote-b-subghz/00std_selftest/00std_selftest.ewp",
"diff": "<option>\n<name>OOCOutputFormat</name>\n<version>3</version>\n- <state>0</state>\n+ <state>1</state>\n</option>\n<option>\n<name>OCOutputOverride</name>\n- <state>0</state>\n+ <state>1</state>\n</option>\n<option>\n<name>OOCOutputFile</name>\n- <state></state>\n+ <state>00std_selftest.hex</state>\n</option>\n<option>\n<name>OOCCommandLineProducer</name>\n</option>\n<option>\n<name>OOCObjCopyEnable</name>\n- <state>0</state>\n+ <state>1</state>\n</option>\n</data>\n</settings>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "projects/openmote-b-subghz/00std_selftest/selftest_esult.py",
"diff": "+import paho.mqtt.client as mqtt\n+import json\n+import base64\n+import time\n+import sys, getopt\n+import Queue\n+import random\n+import struct\n+\n+#============================ defines =========================================\n+BROKER_ADDRESS = \"argus.paris.inria.fr\"\n+\n+#============================ class ===========================================\n+class mqtt_client(object):\n+\n+ def __init__(self):\n+ self.result = {}\n+\n+ #==== mqtt admin\n+\n+ def connect_to_mqtt(self):\n+\n+ mqttclient = mqtt.Client('selftest')\n+ mqttclient.on_connect = self._on_mqtt_connect\n+ mqttclient.on_message = self._on_mqtt_message\n+ mqttclient.connect(BROKER_ADDRESS)\n+ mqttclient.loop_start()\n+\n+ # wait for a while to gather the response from otboxes\n+ time.sleep(10)\n+\n+ # close the client and return the motes list\n+ mqttclient.loop_stop()\n+\n+ with open(\"result.txt\".format(time.time()),'w') as f:\n+ for item, value in self.result.items():\n+ f.write(\"{0}: {1}\".format(item,value))\n+ f.write('\\n')\n+\n+ def _on_mqtt_connect(self, client, userdata, flags, rc):\n+\n+ print \"subscribe to opentestbed/deviceType/mote/deviceId/+/notif/frommoteserialbytes\"\n+ client.subscribe('opentestbed/deviceType/mote/deviceId/+/notif/frommoteserialbytes')\n+\n+\n+ def _on_mqtt_message(self, client, userdata, message):\n+\n+ payload = json.loads(message.payload)\n+\n+ try:\n+ self.result.update({message.topic.split('/')[4]: payload['serialbytes'][:10]})\n+ except:\n+ print \"something wrong\"\n+\n+#============================ main function ===================================\n+mqtt_client().connect_to_mqtt()\n+raw_input('press any key to return')\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n\\ No newline at end of file\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-777. add script to get serial bytes.
|
491,595 |
04.10.2018 10:33:52
| -7,200 |
22199e75f4cae1eba764b8565e0150fe6f87d7f9
|
Release as 1.18.0 version.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n-#define OPENWSN_VERSION_MINOR 17\n+#define OPENWSN_VERSION_MINOR 18\n#define OPENWSN_VERSION_PATCH 0\n#ifndef TRUE\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Release as 1.18.0 version.
|
491,595 |
12.10.2018 14:56:26
| -7,200 |
bff537fe47e43f88496e65cbb6df92f4cd266d30
|
update uart and debugpin driver for openmote-b ports.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/debugpins.c",
"new_path": "bsp/boards/openmote-b-24ghz/debugpins.c",
"diff": "@@ -80,13 +80,13 @@ void debugpins_fsm_set(void) {\n// PB1\nvoid debugpins_task_toggle(void) {\n-// bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n+ bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n}\nvoid debugpins_task_clr(void) {\n-// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n}\nvoid debugpins_task_set(void) {\n-// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n}\n// PC3\n@@ -111,22 +111,25 @@ void debugpins_radio_set(void) {\nGPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, BSP_PINB_0);\n}\n+// isruarttx: not provided by openmote-b\n+void debugpins_isruarttx_toggle(void) {}\n+void debugpins_isruartrx_clr(void) {}\n+void debugpins_isruartrx_set(void) {}\n+// isruartrx: not provided by openmote-b\n+void debugpins_isruartrx_toggle(void) {}\n+void debugpins_isruarttx_clr(void) {}\n+void debugpins_isruarttx_set(void) {}\n+\n//------------ private ------------//\nvoid bspDBpinToggle(uint32_t base, uint8_t ui8Pin)\n{\n- //\n// Get current pin values of selected bits\n- //\nuint32_t ui32Toggle = GPIOPinRead(base, ui8Pin);\n- //\n// Invert selected bits\n- //\nui32Toggle = (~ui32Toggle) & ui8Pin;\n- //\n// Set GPIO\n- //\nGPIOPinWrite(base, ui8Pin, ui32Toggle);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/uart.c",
"new_path": "bsp/boards/openmote-b-24ghz/uart.c",
"diff": "typedef struct {\nuart_tx_cbt txCb;\nuart_rx_cbt rxCb;\n+ bool fXonXoffEscaping;\n+ uint8_t xonXoffEscapedByte;\n} uart_vars_t;\nuart_vars_t uart_vars;\n@@ -111,8 +113,14 @@ void uart_clearTxInterrupts(void) {\n}\nvoid uart_writeByte(uint8_t byteToWrite){\n+ if (byteToWrite==XON || byteToWrite==XOFF || byteToWrite==XONXOFF_ESCAPE) {\n+ uart_vars.fXonXoffEscaping = 0x01;\n+ uart_vars.xonXoffEscapedByte = byteToWrite;\n+ UARTCharPut(UART0_BASE,XONXOFF_ESCAPE);\n+ } else {\nUARTCharPut(UART0_BASE,byteToWrite);\n}\n+}\nuint8_t uart_readByte(void) {\nint32_t i32Char;\n@@ -120,36 +128,51 @@ uint8_t uart_readByte(void) {\nreturn (uint8_t)(i32Char & 0xFF);\n}\n+void uart_setCTS(bool state){\n+ if (state==0x01) {\n+ UARTCharPut(UART0_BASE, XON);\n+ } else {\n+ UARTCharPut(UART0_BASE, XOFF);\n+ }\n+}\n+\n+\n//=========================== interrupt handlers ==============================\nstatic void uart_isr_private(void){\nuint32_t reg;\n- debugpins_isr_set();\n// Read interrupt source\nreg = UARTIntStatus(UART0_BASE, true);\n// Clear UART interrupt in the NVIC\nIntPendClear(INT_UART0);\n-\n// Process TX interrupt\nif(reg & UART_INT_TX){\n+ debugpins_isruarttx_set();\nuart_tx_isr();\n+ debugpins_isruarttx_clr();\n}\n+\n// Process RX interrupt\nif((reg & (UART_INT_RX)) || (reg & (UART_INT_RT))) {\n+ debugpins_isruartrx_set();\nuart_rx_isr();\n+ debugpins_isruartrx_clr();\n}\n-\n- debugpins_isr_clr();\n}\nkick_scheduler_t uart_tx_isr(void) {\nuart_clearTxInterrupts(); // TODO: do not clear, but disable when done\n+ if (uart_vars.fXonXoffEscaping==0x01) {\n+ uart_vars.fXonXoffEscaping = 0x00;\n+ UARTCharPut(UART0_BASE,uart_vars.xonXoffEscapedByte^XONXOFF_MASK);\n+ } else {\nif (uart_vars.txCb != NULL) {\nuart_vars.txCb();\n}\n+ }\nreturn DO_NOT_KICK_SCHEDULER;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/debugpins.c",
"new_path": "bsp/boards/openmote-b-subghz/debugpins.c",
"diff": "@@ -80,13 +80,13 @@ void debugpins_fsm_set(void) {\n// PB1\nvoid debugpins_task_toggle(void) {\n-// bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n+ bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n}\nvoid debugpins_task_clr(void) {\n-// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n}\nvoid debugpins_task_set(void) {\n-// GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n}\n// PC3\n@@ -111,22 +111,25 @@ void debugpins_radio_set(void) {\nGPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, BSP_PINB_0);\n}\n+// isruarttx: not provided by openmote-b\n+void debugpins_isruarttx_toggle(void) {}\n+void debugpins_isruartrx_clr(void) {}\n+void debugpins_isruartrx_set(void) {}\n+// isruartrx: not provided by openmote-b\n+void debugpins_isruartrx_toggle(void) {}\n+void debugpins_isruarttx_clr(void) {}\n+void debugpins_isruarttx_set(void) {}\n+\n//------------ private ------------//\nvoid bspDBpinToggle(uint32_t base, uint8_t ui8Pin)\n{\n- //\n// Get current pin values of selected bits\n- //\nuint32_t ui32Toggle = GPIOPinRead(base, ui8Pin);\n- //\n// Invert selected bits\n- //\nui32Toggle = (~ui32Toggle) & ui8Pin;\n- //\n// Set GPIO\n- //\nGPIOPinWrite(base, ui8Pin, ui32Toggle);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/uart.c",
"new_path": "bsp/boards/openmote-b-subghz/uart.c",
"diff": "typedef struct {\nuart_tx_cbt txCb;\nuart_rx_cbt rxCb;\n+ bool fXonXoffEscaping;\n+ uint8_t xonXoffEscapedByte;\n} uart_vars_t;\nuart_vars_t uart_vars;\n@@ -111,8 +113,14 @@ void uart_clearTxInterrupts(void) {\n}\nvoid uart_writeByte(uint8_t byteToWrite){\n+ if (byteToWrite==XON || byteToWrite==XOFF || byteToWrite==XONXOFF_ESCAPE) {\n+ uart_vars.fXonXoffEscaping = 0x01;\n+ uart_vars.xonXoffEscapedByte = byteToWrite;\n+ UARTCharPut(UART0_BASE,XONXOFF_ESCAPE);\n+ } else {\nUARTCharPut(UART0_BASE,byteToWrite);\n}\n+}\nuint8_t uart_readByte(void) {\nint32_t i32Char;\n@@ -120,36 +128,51 @@ uint8_t uart_readByte(void) {\nreturn (uint8_t)(i32Char & 0xFF);\n}\n+void uart_setCTS(bool state){\n+ if (state==0x01) {\n+ UARTCharPut(UART0_BASE, XON);\n+ } else {\n+ UARTCharPut(UART0_BASE, XOFF);\n+ }\n+}\n+\n+\n//=========================== interrupt handlers ==============================\nstatic void uart_isr_private(void){\nuint32_t reg;\n- debugpins_isr_set();\n// Read interrupt source\nreg = UARTIntStatus(UART0_BASE, true);\n// Clear UART interrupt in the NVIC\nIntPendClear(INT_UART0);\n-\n// Process TX interrupt\nif(reg & UART_INT_TX){\n+ debugpins_isruarttx_set();\nuart_tx_isr();\n+ debugpins_isruarttx_clr();\n}\n+\n// Process RX interrupt\nif((reg & (UART_INT_RX)) || (reg & (UART_INT_RT))) {\n+ debugpins_isruartrx_set();\nuart_rx_isr();\n+ debugpins_isruartrx_clr();\n}\n-\n- debugpins_isr_clr();\n}\nkick_scheduler_t uart_tx_isr(void) {\nuart_clearTxInterrupts(); // TODO: do not clear, but disable when done\n+ if (uart_vars.fXonXoffEscaping==0x01) {\n+ uart_vars.fXonXoffEscaping = 0x00;\n+ UARTCharPut(UART0_BASE,uart_vars.xonXoffEscapedByte^XONXOFF_MASK);\n+ } else {\nif (uart_vars.txCb != NULL) {\nuart_vars.txCb();\n}\n+ }\nreturn DO_NOT_KICK_SCHEDULER;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b/debugpins.c",
"new_path": "bsp/boards/openmote-b/debugpins.c",
"diff": "//=========================== defines =========================================\n// Board dbPINS defines\n#define BSP_PINA_BASE GPIO_A_BASE\n-#define BSP_PINB_BASE GPIO_B_BASE\n#define BSP_PINC_BASE GPIO_C_BASE\n+#define BSP_PINB_BASE GPIO_B_BASE\n-#define BSP_PINA_7 GPIO_PIN_7 // PA7 -- frame\n-#define BSP_PINC_3 GPIO_PIN_3 // PC3 -- slot\n+#define BSP_PINA_7 GPIO_PIN_7 //!< PA7 -- frame -RF1.5\n+#define BSP_PINC_3 GPIO_PIN_3 //!< PC3 -- isr -RF1.11\n-#define BSP_PINB_3 GPIO_PIN_3 // PB3 -- fsm\n-#define BSP_PINB_2 GPIO_PIN_2 // PB2 -- task\n-#define BSP_PINB_1 GPIO_PIN_1 // PB1 -- isr\n-#define BSP_PINB_0 GPIO_PIN_0 // PB0 -- radio\n+#define BSP_PINB_3 GPIO_PIN_3 //!< PB3 -- slot -RF1.6\n+#define BSP_PINB_2 GPIO_PIN_2 //!< PB2 -- fsm -RF1.8\n+#define BSP_PINB_1 GPIO_PIN_1 //!< PB1 -- task -RF1.10\n+#define BSP_PINB_0 GPIO_PIN_0 //!< PB0 -- radio -RF1-12\n//=========================== variables =======================================\n@@ -40,9 +40,9 @@ void debugpins_init(void) {\nGPIOPinTypeGPIOOutput(BSP_PINC_BASE, BSP_PINC_3);\nGPIOPinTypeGPIOOutput(BSP_PINB_BASE, BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0);\n- GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0x00);\n- GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0x00);\n- GPIOPinWrite(BSP_PINB_BASE, (BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0), 0x00);\n+ GPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, 0);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, (BSP_PINB_3 | BSP_PINB_2 | BSP_PINB_1 | BSP_PINB_0), 0);\n}\n// PA7\n@@ -56,64 +56,48 @@ void debugpins_frame_set(void) {\nGPIOPinWrite(BSP_PINA_BASE, BSP_PINA_7, BSP_PINA_7);\n}\n-// PC3\n+// PB3\nvoid debugpins_slot_toggle(void) {\n- bspDBpinToggle(BSP_PINC_BASE, BSP_PINC_3);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_3);\n}\nvoid debugpins_slot_clr(void) {\n- GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, 0);\n}\nvoid debugpins_slot_set(void) {\n- GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, BSP_PINC_3);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, BSP_PINB_3);\n}\n-// PB3\n+// PB2\nvoid debugpins_fsm_toggle(void) {\n- bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_3);\n+ bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_2);\n}\nvoid debugpins_fsm_clr(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, 0);\n}\nvoid debugpins_fsm_set(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_3, BSP_PINB_3);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, BSP_PINB_2);\n}\n-// PB2\n+// PB1\nvoid debugpins_task_toggle(void) {\n- bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_2);\n+ bspDBpinToggle(BSP_PINB_BASE,BSP_PINB_1);\n}\nvoid debugpins_task_clr(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, 0);\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n}\nvoid debugpins_task_set(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_2, BSP_PINB_2);\n-}\n-\n-// isruarttx: not provided by openmote-b\n-void debugpins_isruarttx_toggle(void) {\n-}\n-void debugpins_isruarttx_clr(void) {\n-}\n-void debugpins_isruarttx_set(void) {\n-}\n-\n-// isruartrx: not provided by openmote-b\n-void debugpins_isruartrx_toggle(void) {\n-}\n-void debugpins_isruartrx_clr(void) {\n-}\n-void debugpins_isruartrx_set(void) {\n+ GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n}\n-// PB1\n+// PC3\nvoid debugpins_isr_toggle(void) {\n- bspDBpinToggle(BSP_PINB_BASE, BSP_PINB_1);\n+ bspDBpinToggle(BSP_PINC_BASE, BSP_PINC_3);\n}\nvoid debugpins_isr_clr(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, 0);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, 0);\n}\nvoid debugpins_isr_set(void) {\n- GPIOPinWrite(BSP_PINB_BASE, BSP_PINB_1, BSP_PINB_1);\n+ GPIOPinWrite(BSP_PINC_BASE, BSP_PINC_3, BSP_PINC_3);\n}\n// PB0\n@@ -127,9 +111,19 @@ void debugpins_radio_set(void) {\nGPIOPinWrite(BSP_PINB_BASE, BSP_PINB_0, BSP_PINB_0);\n}\n-//------------ private ------------\n+// isruarttx: not provided by openmote-b\n+void debugpins_isruarttx_toggle(void) {}\n+void debugpins_isruartrx_clr(void) {}\n+void debugpins_isruartrx_set(void) {}\n+// isruartrx: not provided by openmote-b\n+void debugpins_isruartrx_toggle(void) {}\n+void debugpins_isruarttx_clr(void) {}\n+void debugpins_isruarttx_set(void) {}\n+\n+//------------ private ------------//\n-void bspDBpinToggle(uint32_t base, uint8_t ui8Pin){\n+void bspDBpinToggle(uint32_t base, uint8_t ui8Pin)\n+{\n// Get current pin values of selected bits\nuint32_t ui32Toggle = GPIOPinRead(base, ui8Pin);\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b/uart.c",
"new_path": "bsp/boards/openmote-b/uart.c",
"diff": "@@ -142,8 +142,6 @@ void uart_setCTS(bool state){\nstatic void uart_isr_private(void){\nuint32_t reg;\n- debugpins_isr_set();\n-\n// Read interrupt source\nreg = UARTIntStatus(UART0_BASE, true);\n@@ -151,15 +149,18 @@ static void uart_isr_private(void){\nIntPendClear(INT_UART0);\n// Process TX interrupt\nif(reg & UART_INT_TX){\n+ debugpins_isruarttx_set();\nuart_tx_isr();\n+ debugpins_isruarttx_clr();\n}\n+\n// Process RX interrupt\nif((reg & (UART_INT_RX)) || (reg & (UART_INT_RT))) {\n+ debugpins_isruartrx_set();\nuart_rx_isr();\n+ debugpins_isruartrx_clr();\n}\n-\n- debugpins_isr_clr();\n}\nkick_scheduler_t uart_tx_isr(void) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update uart and debugpin driver for openmote-b ports.
|
491,595 |
12.10.2018 17:40:51
| -7,200 |
405e8c680912208be0d4f45ea17e38e6094ae7c3
|
execute the non-TSCH timer in the next interrupt routine after the TIMER_INHIBIT fired, avoiding bytes receiving from serial port interrupted.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -335,6 +335,7 @@ void opentimers_timer_callback(void){\nuint8_t idToSchedule;\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n+ PORT_TIMER_WIDTH tempDuration;\nif (\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning==TRUE &&\n@@ -347,6 +348,22 @@ void opentimers_timer_callback(void){\nsctimer_setCompare(sctimer_readCounter()+SPLITE_TIMER_DURATION);\nreturn;\n} else {\n+ if (opentimers_vars.timersBuf[TIMER_INHIBIT].lastCompareValue == opentimers_vars.currentCompareValue){\n+ for (i=0;i<MAX_NUM_TIMERS;i++){\n+ if (opentimers_vars.timersBuf[i].isrunning==TRUE){\n+ if (i!=TIMER_TSCH && i!=TIMER_INHIBIT && opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue < 497){\n+ tempDuration = opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue;\n+ opentimers_vars.timersBuf[i].currentCompareValue = opentimers_vars.currentCompareValue;\n+ if (opentimers_vars.timersBuf[i].wraps_remaining >0){\n+ if (MAX_TICKS_IN_SINGLE_CLOCK - opentimers_vars.timersBuf[i].lastCompareValue < tempDuration) {\n+ opentimers_vars.timersBuf[i].wraps_remaining++;\n+ }\n+ opentimers_vars.timersBuf[i].lastCompareValue = (opentimers_vars.timersBuf[i].lastCompareValue + tempDuration) & MAX_TICKS_IN_SINGLE_CLOCK;\n+ }\n+ }\n+ }\n+ }\n+ }\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning==TRUE){\nif (opentimers_vars.currentCompareValue == opentimers_vars.timersBuf[i].currentCompareValue){\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. execute the non-TSCH timer in the next interrupt routine after the TIMER_INHIBIT fired, avoiding bytes receiving from serial port interrupted.
|
491,595 |
15.10.2018 11:19:07
| -7,200 |
ad1a37646ce8124ca102133ed21bf1980c3ebc9b
|
call the time_callback when the remain timer duration is less than a PRE_CALL_TIMER_WINDOW after timer_wraps decrease to 0.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -335,7 +335,6 @@ void opentimers_timer_callback(void){\nuint8_t idToSchedule;\nPORT_TIMER_WIDTH timerGap;\nPORT_TIMER_WIDTH tempTimerGap;\n- PORT_TIMER_WIDTH tempDuration;\nif (\nopentimers_vars.timersBuf[TIMER_INHIBIT].isrunning==TRUE &&\n@@ -351,15 +350,8 @@ void opentimers_timer_callback(void){\nif (opentimers_vars.timersBuf[TIMER_INHIBIT].lastCompareValue == opentimers_vars.currentCompareValue){\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isrunning==TRUE){\n- if (i!=TIMER_TSCH && i!=TIMER_INHIBIT && opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue < 497){\n- tempDuration = opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue;\n+ if (i!=TIMER_TSCH && i!=TIMER_INHIBIT && opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue < PRE_CALL_TIMER_WINDOW){\nopentimers_vars.timersBuf[i].currentCompareValue = opentimers_vars.currentCompareValue;\n- if (opentimers_vars.timersBuf[i].wraps_remaining >0){\n- if (MAX_TICKS_IN_SINGLE_CLOCK - opentimers_vars.timersBuf[i].lastCompareValue < tempDuration) {\n- opentimers_vars.timersBuf[i].wraps_remaining++;\n- }\n- opentimers_vars.timersBuf[i].lastCompareValue = (opentimers_vars.timersBuf[i].lastCompareValue + tempDuration) & MAX_TICKS_IN_SINGLE_CLOCK;\n- }\n}\n}\n}\n@@ -393,6 +385,21 @@ void opentimers_timer_callback(void){\nopentimers_vars.timersBuf[i].wraps_remaining--;\nif (opentimers_vars.timersBuf[i].wraps_remaining == 0){\nopentimers_vars.timersBuf[i].currentCompareValue = (opentimers_vars.timersBuf[i].duration+opentimers_vars.timersBuf[i].lastCompareValue) & MAX_TICKS_IN_SINGLE_CLOCK;\n+ if (opentimers_vars.timersBuf[i].currentCompareValue - opentimers_vars.currentCompareValue < PRE_CALL_TIMER_WINDOW){\n+ opentimers_vars.timersBuf[i].isrunning = FALSE;\n+ scheduler_push_task((task_cbt)(opentimers_vars.timersBuf[i].callback),TASKPRIO_OPENTIMERS);\n+ if (opentimers_vars.timersBuf[i].timerType==TIMER_PERIODIC){\n+ opentimers_vars.insideISR = TRUE;\n+ opentimers_scheduleIn(\n+ i,\n+ opentimers_vars.timersBuf[i].duration,\n+ TIME_TICS,\n+ TIMER_PERIODIC,\n+ opentimers_vars.timersBuf[i].callback\n+ );\n+ opentimers_vars.insideISR = FALSE;\n+ }\n+ }\n} else {\nopentimers_vars.timersBuf[i].currentCompareValue = opentimers_vars.timersBuf[i].lastCompareValue + MAX_TICKS_IN_SINGLE_CLOCK;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "#define TIMER_NUMBER_NON_GENERAL 2\n#define SPLITE_TIMER_DURATION 15 // in ticks\n+#define PRE_CALL_TIMER_WINDOW PORT_TsSlotDuration\ntypedef void (*opentimers_cbt)(opentimers_id_t id);\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. call the time_callback when the remain timer duration is less than a PRE_CALL_TIMER_WINDOW after timer_wraps decrease to 0.
|
491,595 |
15.10.2018 14:27:10
| -7,200 |
d1daf8a37de9cd5a7463a6f96b60015ce8af15d7
|
remove no-needed codes in openserial_inhibitStart function.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -486,17 +486,15 @@ void openserial_flush(void) {\n}\nvoid openserial_inhibitStart(void) {\n- INTERRUPT_DECLARATION();\n+ // this function needs to run in non-interrupt mode\n+ // since the inhibitStart is always called in an interrupt mode,\n+ // DISABLE_INTERRUPT is not necessary here.\n- //<<<<<<<<<<<<<<<<<<<<<<<\n- DISABLE_INTERRUPTS();\nopenserial_vars.fInhibited = TRUE;\n#ifdef FASTSIM\n#else\nopenserial_vars.ctsStateChanged = TRUE;\n#endif\n- ENABLE_INTERRUPTS();\n- //>>>>>>>>>>>>>>>>>>>>>>>\n// it's openserial_flush() which will set CTS\nopenserial_flush();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. remove no-needed codes in openserial_inhibitStart function.
|
491,595 |
16.10.2018 12:16:20
| -7,200 |
d99624ca676c0afb7f54b68f96c5805d61add29a
|
user periodical timer and update the duration use updateDuration function.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.c",
"new_path": "drivers/common/opentimers.c",
"diff": "@@ -99,8 +99,6 @@ void opentimers_scheduleIn(opentimers_id_t id,\nPORT_TIMER_WIDTH tempTimerGap;\nINTERRUPT_DECLARATION();\n- DISABLE_INTERRUPTS();\n-\n// 1. make sure the timer exist\nfor (i=0;i<MAX_NUM_TIMERS;i++){\nif (opentimers_vars.timersBuf[i].isUsed && i == id){\n@@ -112,6 +110,8 @@ void opentimers_scheduleIn(opentimers_id_t id,\nreturn;\n}\n+ DISABLE_INTERRUPTS();\n+\nopentimers_vars.timersBuf[id].timerType = timer_type;\n// 2. updat the timer content\n@@ -189,7 +189,6 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nPORT_TIMER_WIDTH tempTimerGap;\nINTERRUPT_DECLARATION();\n- DISABLE_INTERRUPTS();\n// 1. make sure the timer exist\nfor (i=0;i<MAX_NUM_TIMERS;i++){\n@@ -202,6 +201,8 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nreturn;\n}\n+ DISABLE_INTERRUPTS();\n+\n// absolute scheduling is for one shot timer\nopentimers_vars.timersBuf[id].timerType = TIMER_ONESHOT;\n@@ -256,6 +257,24 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nENABLE_INTERRUPTS();\n}\n+/**\n+\\brief update the duration of timer.\n+\n+This function should be called in the callback of the timer interrupt.\n+\n+\\param[in] id the timer id\n+\\param[in] duration the timer duration\n+ */\n+void opentimers_updateDuration(opentimers_id_t id,\n+ PORT_TIMER_WIDTH duration){\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ opentimers_vars.timersBuf[id].duration = duration;\n+\n+ ENABLE_INTERRUPTS();\n+}\n+\n/**\n\\brief cancel a running timer.\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "@@ -84,6 +84,8 @@ void opentimers_scheduleAbsolute(opentimers_id_t id,\nPORT_TIMER_WIDTH reference ,\ntime_type_t uint_type,\nopentimers_cbt cb);\n+void opentimers_updateDuration(opentimers_id_t id,\n+ PORT_TIMER_WIDTH duration);\nvoid opentimers_cancel(opentimers_id_t id);\nbool opentimers_destroy(opentimers_id_t id);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -51,7 +51,7 @@ void msf_init(void) {\nmsf_vars.housekeepingTimerId,\nopenrandom_getRandomizePeriod(msf_vars.housekeepingPeriod, msf_vars.housekeepingPeriod),\nTIME_MS,\n- TIMER_ONESHOT,\n+ TIMER_PERIODIC,\nmsf_timer_housekeeping_cb\n);\nmsf_vars.waitretryTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n@@ -163,15 +163,12 @@ void msf_timer_waitretry_cb(opentimers_id_t id){\n}\nvoid msf_timer_housekeeping_cb(opentimers_id_t id){\n+ PORT_TIMER_WIDTH newDuration;\n+\nscheduler_push_task(msf_timer_housekeeping_task,TASKPRIO_MSF);\n- // update the period\n- opentimers_scheduleIn(\n- msf_vars.housekeepingTimerId,\n- openrandom_getRandomizePeriod(msf_vars.housekeepingPeriod, msf_vars.housekeepingPeriod),\n- TIME_MS,\n- TIMER_ONESHOT,\n- msf_timer_housekeeping_cb\n- );\n+\n+ newDuration = openrandom_getRandomizePeriod(msf_vars.housekeepingPeriod, msf_vars.housekeepingPeriod),\n+ opentimers_updateDuration(msf_vars.housekeepingTimerId, newDuration);\n}\nvoid msf_timer_housekeeping_task(void){\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -174,7 +174,7 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.timerIdDAO,\nopenrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION),\nTIME_MS,\n- TIMER_ONESHOT,\n+ TIMER_PERIODIC,\nicmpv6rpl_timer_DAO_cb\n);\n}\n@@ -767,16 +767,12 @@ void sendDIO(void) {\ntask.\n*/\nvoid icmpv6rpl_timer_DAO_cb(opentimers_id_t id) {\n+ PORT_TIMER_WIDTH newDuration;\nscheduler_push_task(icmpv6rpl_timer_DAO_task,TASKPRIO_RPL);\n- // update the period\n- opentimers_scheduleIn(\n- icmpv6rpl_vars.timerIdDAO,\n- openrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION),\n- TIME_MS,\n- TIMER_ONESHOT,\n- icmpv6rpl_timer_DAO_cb\n- );\n+\n+ newDuration = openrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION);\n+ opentimers_updateDuration(icmpv6rpl_vars.timerIdDAO, newDuration);\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_macpong/03oos_macpong.c",
"new_path": "projects/common/03oos_macpong/03oos_macpong.c",
"diff": "@@ -59,14 +59,6 @@ void macpong_initSend(opentimers_id_t id) {\ndefault:\nbreak;\n}\n- opentimers_scheduleIn(\n- macpong_vars.timerId, // id\n- 1000, // duration\n- TIME_MS, // time_type\n- TIMER_ONESHOT, // timer_type\n- macpong_initSend // callback\n- );\n-\nif (idmanager_getIsDAGroot()==TRUE) {\nreturn;\n@@ -117,7 +109,7 @@ void iphc_init(void) {\nmacpong_vars.timerId, // timerId\n1000, // duration\nTIME_MS, // timetype\n- TIMER_ONESHOT, // timertype\n+ TIMER_PERIODIC, // timertype\nmacpong_initSend // callback\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -440,6 +440,7 @@ functionsToChange = [\n'opentimers_create',\n'opentimers_scheduleIn',\n'opentimers_scheduleAbsolute',\n+ 'opentimers_updateDuration',\n'opentimers_cancel',\n'opentimers_destroy',\n'opentimers_getValue',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. user periodical timer and update the duration use updateDuration function.
|
491,595 |
16.10.2018 15:53:53
| -7,200 |
2df5c690de757f9fcdaab49f4fe60c86321d1845
|
updating the timing for telosb.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/telosb/board_info.h",
"new_path": "bsp/boards/telosb/board_info.h",
"diff": "@@ -56,19 +56,19 @@ to this board.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n// execution speed related\n-#define PORT_maxTxDataPrepare 100 // 2899us (measured 2516us)\n-#define PORT_maxRxAckPrepare 20 // 610us (measured 474us)\n+#define PORT_maxTxDataPrepare 110 // 3355us (measured 2989us)\n+#define PORT_maxRxAckPrepare 20 // 610us (measured 409us)\n#define PORT_maxRxDataPrepare 33 // 1000us (measured 477us)\n-#define PORT_maxTxAckPrepare 45 // 1372us (measured 1328us)- cannot be bigger than 28.. is the limit for telosb as actvitiy_rt5 is executed almost there.\n+#define PORT_maxTxAckPrepare 50 // 1525us (measured 1405us)\n// radio speed related\n-#define PORT_delayTx 16 // 488us (measured 473us)\n+#define PORT_delayTx 18 // 488us (measured 539us)\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -164,10 +164,10 @@ enum ieee154e_atomicdurations_enum {\nTsTxAckDelay = 33, // 1000us\nTsShortGT = 13, // 500us, The standardlized value for this is 400/2=200us(7ticks). Currectly 7 doesn't work for short packet, change it back to 7 when found the problem.\n#endif\n-#if SLOTDURATION==15\n- TsTxOffset = 131, // 4000us\n+#if SLOTDURATION==20\n+ TsTxOffset = 171, // 5215us\nTsLongGT = 43, // 1300us\n- TsTxAckDelay = 151, // 4606us\n+ TsTxAckDelay = 181, // 5521us\nTsShortGT = 16, // 500us\n#endif\nTsSlotDuration = PORT_TsSlotDuration, // 10000us\n@@ -185,7 +185,7 @@ enum ieee154e_atomicdurations_enum {\n#if SLOTDURATION==10\nwdAckDuration = 80, // 2400us (measured 1000us)\n#endif\n-#if SLOTDURATION==15\n+#if SLOTDURATION==20\nwdAckDuration = 98, // 3000us (measured 1000us)\n#endif\n};\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. updating the timing for telosb.
|
491,595 |
16.10.2018 15:55:03
| -7,200 |
9fcf0ef2ee2d87a8538b8be9f211d61d27bfed36
|
fix macpong project. send macpong packet through dedicated cell between two nodes.
|
[
{
"change_type": "MODIFY",
"old_path": "projects/common/03oos_macpong/03oos_macpong.c",
"new_path": "projects/common/03oos_macpong/03oos_macpong.c",
"diff": "@@ -51,6 +51,8 @@ int mote_main(void) {\nvoid macpong_initSend(opentimers_id_t id) {\nbool timeToSend = FALSE;\n+ open_addr_t temp;\n+\nmacpong_vars.macpongCounter = (macpong_vars.macpongCounter+1)%5;\nswitch (macpong_vars.macpongCounter) {\ncase 0:\n@@ -64,6 +66,8 @@ void macpong_initSend(opentimers_id_t id) {\nreturn;\n}\nif (ieee154e_isSynch()==TRUE && neighbors_getNumNeighbors()==1) {\n+ neighbors_getNeighborEui64(&temp,ADDR_64B,0);\n+ if (schedule_hasDedicatedCellToNeighbor(&temp)){\nif (timeToSend){\n// send packet\nmacpong_send(0);\n@@ -72,6 +76,7 @@ void macpong_initSend(opentimers_id_t id) {\n}\n}\n}\n+}\nvoid macpong_send(uint8_t payloadCtr) {\nOpenQueueEntry_t* pkt;\n@@ -151,11 +156,30 @@ bool icmpv6rpl_getPreferredParentIndex(uint8_t* indexptr) {\nreturn FALSE;\n}\nbool icmpv6rpl_getPreferredParentEui64(open_addr_t* addressToWrite) {\n+\n+ if (idmanager_getIsDAGroot()==TRUE) {\nreturn FALSE;\n}\n+\n+ if (ieee154e_isSynch()==TRUE && neighbors_getNumNeighbors()==1) {\n+ neighbors_getNeighborEui64(addressToWrite,ADDR_64B,0);\n+ }\n+ return TRUE;\n+}\nbool icmpv6rpl_isPreferredParent(open_addr_t* address) {\n+\n+ open_addr_t temp;\n+ if (idmanager_getIsDAGroot()==TRUE) {\nreturn FALSE;\n}\n+\n+ if (address->type == ADDR_64B) {\n+ neighbors_getNeighborEui64(&temp,ADDR_64B,0);\n+ return packetfunctions_sameAddress(address,&temp);\n+ } else {\n+ return FALSE;\n+ }\n+}\ndagrank_t icmpv6rpl_getMyDAGrank(void) {\nreturn 0;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. fix macpong project. send macpong packet through dedicated cell between two nodes.
|
491,595 |
16.10.2018 18:26:53
| -7,200 |
b0b0da1590da02168347e88e6091b8cfc010fbf0
|
update timing for openmote-b-24ghz
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"new_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"diff": "#define PORT_PIN_RADIO_RESET_HIGH() // nothing\n#define PORT_PIN_RADIO_RESET_LOW() // nothing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n//===== IEEE802154E timing\n// radio watchdog\n#endif\n-#if SLOTDURATION==15\n- // time-slot related\n- #define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n+#if SLOTDURATION==20\n+ #define PORT_TsSlotDuration 655 // 20ms\n+\n// execution speed related\n- #define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n- #define PORT_maxRxAckPrepare 30 // 305us (measured 83us)\n- #define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n- #define PORT_maxTxAckPrepare 32 // 305us (measured 219us)\n+ #define PORT_maxTxDataPrepare 110 // 3355us (measured 2989us)\n+ #define PORT_maxRxAckPrepare 20 // 610us (measured 409us)\n+ #define PORT_maxRxDataPrepare 33 // 1000us (measured 477us)\n+ #define PORT_maxTxAckPrepare 50 // 1525us (measured 1405us)\n+\n// radio speed related\n- #define PORT_delayTx 12 // 214us (measured 219us)\n+ #define PORT_delayTx 12 // 488us (measured 539us)\n#define PORT_delayRx 0 // 0us (can not measure)\n- // radio watchdog\n#endif\n//===== adaptive_sync accuracy\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update timing for openmote-b-24ghz
|
491,595 |
17.10.2018 10:55:58
| -7,200 |
136721882801bb75d8862da8c611def511eab6fe
|
update all boards to 20ms slot duration.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/gina/board_info.h",
"new_path": "bsp/boards/gina/board_info.h",
"diff": "@@ -61,18 +61,19 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n// execution speed related\n-#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n-#define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n-#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n-#define PORT_maxTxAckPrepare 22 // 305us (measured 219us)\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n-#define PORT_delayTx 7 // 214us (measured 219us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/iot-lab_A8-M3/board_info.h",
"new_path": "bsp/boards/iot-lab_A8-M3/board_info.h",
"diff": "@@ -51,17 +51,19 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 491 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n+\n// execution speed related\n-#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n-#define PORT_maxRxAckPrepare 20 // 305us (measured 83us)\n-#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n-#define PORT_maxTxAckPrepare 30 // 305us (measured 219us)\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n-#define PORT_delayTx 10 // 214us (measured 219us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/iot-lab_M3/board_info.h",
"new_path": "bsp/boards/iot-lab_M3/board_info.h",
"diff": "@@ -50,17 +50,19 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 491 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n+\n// execution speed related\n-#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n-#define PORT_maxRxAckPrepare 20 // 305us (measured 83us)\n-#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n-#define PORT_maxTxAckPrepare 30 // 305us (measured 219us)\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n-#define PORT_delayTx 10 // 214us (measured 219us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-cc2538/board_info.h",
"new_path": "bsp/boards/openmote-cc2538/board_info.h",
"diff": "// radio watchdog\n#endif\n-#if SLOTDURATION==15\n+#if SLOTDURATION==20\n// time-slot related\n#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n// execution speed related\n- #define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n- #define PORT_maxRxAckPrepare 10 // 305us (measured 83us)\n- #define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n- #define PORT_maxTxAckPrepare 22 // 305us (measured 219us)\n+ #define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+ #define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+ #define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+ #define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n- #define PORT_delayTx 12 // 214us (measured 219us)\n+ #define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/samr21_xpro/board_info.h",
"new_path": "bsp/boards/samr21_xpro/board_info.h",
"diff": "@@ -73,17 +73,20 @@ typedef uint32_t irqflags_t;\n#define PORT_PIN_RADIO_RESET_HIGH() //RST_HIGH()\n#define PORT_PIN_RADIO_RESET_LOW() //RST_LOW()\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n-//===== IEEE802154E timing\n// time-slot related\n-#define PORT_TsSlotDuration 491\n-#define PORT_maxTxDataPrepare 66//33//66\n-#define PORT_maxRxAckPrepare 20//10\n-#define PORT_maxRxDataPrepare 33//33\n-#define PORT_maxTxAckPrepare 30//22\n-#define PORT_delayTx 20//15\n-#define PORT_delayRx 0\n+#define PORT_TsSlotDuration 655 // 20ms\n+\n+// execution speed related\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n+// radio speed related\n+#define PORT_delayTx 18 // 549us (not measured)\n+#define PORT_delayRx 0 // 0us (can not measure)\n#define SYNC_ACCURACY 1 // ticks\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/telosb/board_info.h",
"new_path": "bsp/boards/telosb/board_info.h",
"diff": "@@ -68,7 +68,7 @@ to this board.\n#define PORT_maxTxAckPrepare 50 // 1525us (measured 1405us)\n// radio speed related\n-#define PORT_delayTx 18 // 488us (measured 539us)\n+#define PORT_delayTx 18 // 549us (measured 539us)\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/wsn430v13b/board_info.h",
"new_path": "bsp/boards/wsn430v13b/board_info.h",
"diff": "@@ -70,19 +70,19 @@ to this board.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 491 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n// execution speed related\n-#define PORT_maxTxDataPrepare 100 // 2899us (measured 2420us)\n-#define PORT_maxRxAckPrepare 20 // 610us (measured 474us)\n-#define PORT_maxRxDataPrepare 33 // 1000us (measured 477us)\n-#define PORT_maxTxAckPrepare 40 // 792us (measured 746us)- cannot be bigger than 28.. is the limit for telosb as actvitiy_rt5 is executed almost there.\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n// radio speed related\n-#define PORT_delayTx 12 // 366us (measured 352us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/wsn430v14/board_info.h",
"new_path": "bsp/boards/wsn430v14/board_info.h",
"diff": "@@ -55,19 +55,19 @@ to this board.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n// execution speed related\n-#define PORT_maxTxDataPrepare 100 // 2899us (measured 2420us)\n-#define PORT_maxRxAckPrepare 20 // 610us (measured 474us)\n-#define PORT_maxRxDataPrepare 33 // 1000us (measured 477us)\n-#define PORT_maxTxAckPrepare 40 // 792us (measured 746us)- cannot be bigger than 28.. is the limit for telosb as actvitiy_rt5 is executed almost there.\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n// radio speed related\n-#define PORT_delayTx 12 // 366us (measured 352us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n//===== adaptive_sync accuracy\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/z1/board_info.h",
"new_path": "bsp/boards/z1/board_info.h",
"diff": "@@ -58,17 +58,19 @@ to return the board's description.\n//===== IEEE802154E timing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n// time-slot related\n-#define PORT_TsSlotDuration 491 // counter counts one extra count, see datasheet\n+#define PORT_TsSlotDuration 655 // 20ms\n+\n// execution speed related\n-#define PORT_maxTxDataPrepare 88 // 2014us (measured 746us)\n-#define PORT_maxRxAckPrepare 20 // 305us (measured 83us)\n-#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n-#define PORT_maxTxAckPrepare 40 // 305us (measured 219us)\n+#define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+#define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+#define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+#define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n-#define PORT_delayTx 12 // 214us (measured 219us)\n+#define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n// radio watchdog\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update all boards to 20ms slot duration.
|
491,595 |
17.10.2018 11:08:49
| -7,200 |
7fbb50f8c8ec5e168583b8cab3c44fc116184347
|
update openmote-b-24ghz timing.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"new_path": "bsp/boards/openmote-b-24ghz/board_info.h",
"diff": "#define PORT_TsSlotDuration 655 // 20ms\n// execution speed related\n- #define PORT_maxTxDataPrepare 110 // 3355us (measured 2989us)\n- #define PORT_maxRxAckPrepare 20 // 610us (measured 409us)\n- #define PORT_maxRxDataPrepare 33 // 1000us (measured 477us)\n- #define PORT_maxTxAckPrepare 50 // 1525us (measured 1405us)\n+ #define PORT_maxTxDataPrepare 15 // 458us (measured 213us)\n+ #define PORT_maxRxAckPrepare 10 // 305us (measured 86us)\n+ #define PORT_maxRxDataPrepare 10 // 305us (measured 88us)\n+ #define PORT_maxTxAckPrepare 15 // 458us (measured 211us)\n// radio speed related\n- #define PORT_delayTx 12 // 488us (measured 539us)\n+ #define PORT_delayTx 13 // 397us (measured 388us)\n#define PORT_delayRx 0 // 0us (can not measure)\n#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-24ghz/sctimer.c",
"new_path": "bsp/boards/openmote-b-24ghz/sctimer.c",
"diff": "// ========================== define ==========================================\n#define TIMERLOOP_THRESHOLD 0xffffff // 511 seconds @ 32768Hz clock\n-#define MINIMUM_COMPAREVALE_ADVANCE 10\n+#define MINIMUM_COMPAREVALE_ADVANCE 5\n// ========================== variable ========================================\n@@ -56,7 +56,7 @@ void sctimer_setCompare(uint32_t val){\n} else {\nif (val-SleepModeTimerCountGet()<MINIMUM_COMPAREVALE_ADVANCE){\n// there is hardware limitation to schedule the timer within TIMERTHRESHOLD ticks\n- // schedule ISR right now manually\n+ // schedule ISR right now manually (see user guide 13.2)\nIntPendSet(INT_SMTIM);\n} else {\n// schedule the timer at val\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update openmote-b-24ghz timing.
|
491,595 |
17.10.2018 12:17:11
| -7,200 |
fdefc66c04acece8cc325bfc43acee945e11c151
|
wdAckDuration's value is not related to slot duration.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -182,12 +182,7 @@ enum ieee154e_atomicdurations_enum {\n// radio watchdog\nwdRadioTx = 45, // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works)\nwdDataDuration = 164, // 5000us (measured 4280us with max payload)\n-#if SLOTDURATION==10\n- wdAckDuration = 80, // 2400us (measured 1000us)\n-#endif\n-#if SLOTDURATION==20\nwdAckDuration = 98, // 3000us (measured 1000us)\n-#endif\n};\n//shift of bytes in the linkOption bitmap: draft-ietf-6tisch-minimal-10.txt: page 6\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. wdAckDuration's value is not related to slot duration.
|
491,595 |
17.10.2018 16:51:48
| -7,200 |
f2cd1cfbfb2ee583d93d3c72aa48edd9394de863
|
update openmote-b-subghz timing.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/openmote-b-subghz/board_info.h",
"new_path": "bsp/boards/openmote-b-subghz/board_info.h",
"diff": "#define PORT_PIN_RADIO_RESET_HIGH() // nothing\n#define PORT_PIN_RADIO_RESET_LOW() // nothing\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n//===== IEEE802154E timing\n// radio watchdog\n#endif\n-#if SLOTDURATION==15\n- // time-slot related\n- #define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet\n+#if SLOTDURATION==20\n+ #define PORT_TsSlotDuration 655 // 20ms\n+\n// execution speed related\n- #define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)\n- #define PORT_maxRxAckPrepare 30 // 305us (measured 83us)\n- #define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)\n- #define PORT_maxTxAckPrepare 32 // 305us (measured 219us)\n+ #define PORT_maxTxDataPrepare 110 // 3355us (not measured)\n+ #define PORT_maxRxAckPrepare 20 // 610us (not measured)\n+ #define PORT_maxRxDataPrepare 33 // 1000us (not measured)\n+ #define PORT_maxTxAckPrepare 50 // 1525us (not measured)\n+\n// radio speed related\n- #define PORT_delayTx 12 // 214us (measured 219us)\n+ #define PORT_delayTx 18 // 549us (not measured)\n#define PORT_delayRx 0 // 0us (can not measure)\n- // radio watchdog\n#endif\n//===== adaptive_sync accuracy\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. update openmote-b-subghz timing.
|
491,595 |
17.10.2018 16:54:13
| -7,200 |
26731cba3ade02e60f25e704f0e7dcaf85265894
|
check the status by reading status register rather than wait for a flag changed by interrupt.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/chips/at86rf215/radio.c",
"new_path": "bsp/chips/at86rf215/radio.c",
"diff": "@@ -43,7 +43,6 @@ typedef struct {\nuint8_t rf24_isr;\nuint8_t bb0_isr;\nuint8_t bb1_isr;\n- bool trx_ready;\n} radio_vars_t;\nradio_vars_t radio_vars;\n@@ -219,12 +218,8 @@ void radio_txEnable(void) {\n// change state\nradio_vars.state = RADIOSTATE_ENABLING_TX;\n- if(at86rf215_status() != RF_STATE_TXPREP){\n- radio_vars.trx_ready = FALSE;\n- // change status to TXPREP\nat86rf215_spiStrobe(CMD_RF_TXPREP);\n- while(!radio_vars.trx_ready);\n- }\n+ while(at86rf215_status() != RF_STATE_TXPREP);\n// wiggle debug pin\ndebugpins_radio_set();\n@@ -317,11 +312,6 @@ void radio_isr(void) {\n//get isr that happened from radio\nradio_read_isr();\n- if (radio_vars.rf09_isr & IRQS_TRXRDY_MASK){\n- // trx_ready\n- radio_vars.trx_ready = TRUE;\n- }\n-\nif (radio_vars.bb0_isr & IRQS_RXFS_MASK){\nradio_vars.state = RADIOSTATE_RECEIVING;\nif (radio_vars.startFrame_cb!=NULL) {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-780. check the status by reading status register rather than wait for a flag changed by interrupt.
|
491,595 |
17.10.2018 17:56:58
| -7,200 |
87b1f7d99dffb21c75657ccc4124d84272242c06
|
send DAO in a constant interval.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -172,7 +172,7 @@ void icmpv6rpl_init(void) {\nicmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nicmpv6rpl_vars.timerIdDAO,\n- openrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION),\n+ icmpv6rpl_vars.daoPeriod,\nTIME_MS,\nTIMER_PERIODIC,\nicmpv6rpl_timer_DAO_cb\n@@ -767,12 +767,7 @@ void sendDIO(void) {\ntask.\n*/\nvoid icmpv6rpl_timer_DAO_cb(opentimers_id_t id) {\n- PORT_TIMER_WIDTH newDuration;\n-\nscheduler_push_task(icmpv6rpl_timer_DAO_task,TASKPRIO_RPL);\n-\n- newDuration = openrandom_getRandomizePeriod(icmpv6rpl_vars.daoPeriod, NUM_CHANNELS*SLOTFRAME_LENGTH*SLOTDURATION);\n- opentimers_updateDuration(icmpv6rpl_vars.timerIdDAO, newDuration);\n}\n/**\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-781. send DAO in a constant interval.
|
491,605 |
18.10.2018 12:39:10
| -7,200 |
3b7742d36b81513497201ba8cead7a2aef5ec5a3
|
Fixed the problem of UART dropping received characters by utilizing a FIFO.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840/SConscript",
"new_path": "bsp/boards/nrf52840/SConscript",
"diff": "@@ -15,17 +15,19 @@ source = \\\nGlob('sdk/components/boards/boards.c') + \\\nGlob('sdk/components/libraries/experimental_section_vars/*.c') + \\\nGlob('sdk/components/libraries/pwr_mgmt/*.c') + \\\n- Glob('sdk/components/libraries/uart/app_uart.c') + \\\n+ Glob('sdk/components/libraries/util/app_error.c') + \\\n+ Glob('sdk/components/libraries/fifo/app_fifo.c') + \\\n+ Glob('sdk/components/libraries/uart/app_uart_fifo.c') + \\\nGlob('sdk/components/libraries/util/app_util_platform.c') + \\\n+ Glob('sdk/integration/nrfx/legacy/nrf_drv_clock.c') + \\\nGlob('sdk/integration/nrfx/legacy/nrf_drv_uart.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_clock.c') + \\\n- Glob('sdk/integration/nrfx/legacy/nrf_drv_clock.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_power.c') + \\\n- Glob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\n- Glob('sdk/modules/nrfx/drivers/src/nrfx_uart.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_saadc.c') + \\\n- Glob('sdk/modules/nrfx/drivers/src/nrfx_twi.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_spi.c') + \\\nGlob('sdk/modules/nrfx/drivers/src/nrfx_systick.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_twi.c') + \\\n+ Glob('sdk/modules/nrfx/drivers/src/nrfx_uart.c') + \\\nGlob('sdk/modules/nrfx/mdk/gcc_startup_nrf52840.S') + \\\nGlob('sdk/modules/nrfx/mdk/system_nrf52840.c') + \\\nGlob('sdk/components/drivers_nrf/radio_config/radio_config.c') + \\\n@@ -45,6 +47,7 @@ localEnv.Append(\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','experimental_log','src'),\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','experimental_memobj'),\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','experimental_section_vars'),\n+ os.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','fifo'),\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','mutex'),\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','uart'),\nos.path.join('#','bsp','boards','nrf52840','sdk','components','libraries','util'),\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840/app_config.h",
"new_path": "bsp/boards/nrf52840/app_config.h",
"diff": "// clock\n#define CLOCK_ENABLED 1\n+// FIFO\n+#define APP_FIFO_ENABLED 1\n+\n// UART\n#define UART_ENABLED 1\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840/sdk/components/libraries/fifo/app_fifo.c",
"diff": "+/**\n+ * Copyright (c) 2013 - 2018, Nordic Semiconductor ASA\n+ *\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without modification,\n+ * are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice, this\n+ * list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form, except as embedded into a Nordic\n+ * Semiconductor ASA integrated circuit in a product or a software update for\n+ * such product, must reproduce the above copyright notice, this list of\n+ * conditions and the following disclaimer in the documentation and/or other\n+ * materials provided with the distribution.\n+ *\n+ * 3. Neither the name of Nordic Semiconductor ASA nor the names of its\n+ * contributors may be used to endorse or promote products derived from this\n+ * software without specific prior written permission.\n+ *\n+ * 4. This software, with or without modification, must only be used with a\n+ * Nordic Semiconductor ASA integrated circuit.\n+ *\n+ * 5. Any software provided in binary form under this license must not be reverse\n+ * engineered, decompiled, modified and/or disassembled.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA \"AS IS\" AND ANY EXPRESS\n+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n+ * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ */\n+#include \"sdk_common.h\"\n+#if NRF_MODULE_ENABLED(APP_FIFO)\n+#include \"app_fifo.h\"\n+\n+static __INLINE uint32_t fifo_length(app_fifo_t * p_fifo)\n+{\n+ uint32_t tmp = p_fifo->read_pos;\n+ return p_fifo->write_pos - tmp;\n+}\n+\n+\n+#define FIFO_LENGTH() fifo_length(p_fifo) /**< Macro for calculating the FIFO length. */\n+\n+\n+/**@brief Put one byte to the FIFO. */\n+static __INLINE void fifo_put(app_fifo_t * p_fifo, uint8_t byte)\n+{\n+ p_fifo->p_buf[p_fifo->write_pos & p_fifo->buf_size_mask] = byte;\n+ p_fifo->write_pos++;\n+}\n+\n+\n+/**@brief Look at one byte in the FIFO. */\n+static __INLINE void fifo_peek(app_fifo_t * p_fifo, uint16_t index, uint8_t * p_byte)\n+{\n+ *p_byte = p_fifo->p_buf[(p_fifo->read_pos + index) & p_fifo->buf_size_mask];\n+}\n+\n+\n+/**@brief Get one byte from the FIFO. */\n+static __INLINE void fifo_get(app_fifo_t * p_fifo, uint8_t * p_byte)\n+{\n+ fifo_peek(p_fifo, 0, p_byte);\n+ p_fifo->read_pos++;\n+}\n+\n+\n+uint32_t app_fifo_init(app_fifo_t * p_fifo, uint8_t * p_buf, uint16_t buf_size)\n+{\n+ // Check buffer for null pointer.\n+ if (p_buf == NULL)\n+ {\n+ return NRF_ERROR_NULL;\n+ }\n+\n+ // Check that the buffer size is a power of two.\n+ if (!IS_POWER_OF_TWO(buf_size))\n+ {\n+ return NRF_ERROR_INVALID_LENGTH;\n+ }\n+\n+ p_fifo->p_buf = p_buf;\n+ p_fifo->buf_size_mask = buf_size - 1;\n+ p_fifo->read_pos = 0;\n+ p_fifo->write_pos = 0;\n+\n+ return NRF_SUCCESS;\n+}\n+\n+\n+uint32_t app_fifo_put(app_fifo_t * p_fifo, uint8_t byte)\n+{\n+ if (FIFO_LENGTH() <= p_fifo->buf_size_mask)\n+ {\n+ fifo_put(p_fifo, byte);\n+ return NRF_SUCCESS;\n+ }\n+\n+ return NRF_ERROR_NO_MEM;\n+}\n+\n+\n+uint32_t app_fifo_get(app_fifo_t * p_fifo, uint8_t * p_byte)\n+{\n+ if (FIFO_LENGTH() != 0)\n+ {\n+ fifo_get(p_fifo, p_byte);\n+ return NRF_SUCCESS;\n+ }\n+\n+ return NRF_ERROR_NOT_FOUND;\n+\n+}\n+\n+\n+uint32_t app_fifo_peek(app_fifo_t * p_fifo, uint16_t index, uint8_t * p_byte)\n+{\n+ if (FIFO_LENGTH() > index)\n+ {\n+ fifo_peek(p_fifo, index, p_byte);\n+ return NRF_SUCCESS;\n+ }\n+\n+ return NRF_ERROR_NOT_FOUND;\n+}\n+\n+\n+uint32_t app_fifo_flush(app_fifo_t * p_fifo)\n+{\n+ p_fifo->read_pos = p_fifo->write_pos;\n+ return NRF_SUCCESS;\n+}\n+\n+\n+uint32_t app_fifo_read(app_fifo_t * p_fifo, uint8_t * p_byte_array, uint32_t * p_size)\n+{\n+ VERIFY_PARAM_NOT_NULL(p_fifo);\n+ VERIFY_PARAM_NOT_NULL(p_size);\n+\n+ const uint32_t byte_count = fifo_length(p_fifo);\n+ const uint32_t requested_len = (*p_size);\n+ uint32_t index = 0;\n+ uint32_t read_size = MIN(requested_len, byte_count);\n+\n+ (*p_size) = byte_count;\n+\n+ // Check if the FIFO is empty.\n+ if (byte_count == 0)\n+ {\n+ return NRF_ERROR_NOT_FOUND;\n+ }\n+\n+ // Check if application has requested only the size.\n+ if (p_byte_array == NULL)\n+ {\n+ return NRF_SUCCESS;\n+ }\n+\n+ // Fetch bytes from the FIFO.\n+ while (index < read_size)\n+ {\n+ fifo_get(p_fifo, &p_byte_array[index++]);\n+ }\n+\n+ (*p_size) = read_size;\n+\n+ return NRF_SUCCESS;\n+}\n+\n+\n+uint32_t app_fifo_write(app_fifo_t * p_fifo, uint8_t const * p_byte_array, uint32_t * p_size)\n+{\n+ VERIFY_PARAM_NOT_NULL(p_fifo);\n+ VERIFY_PARAM_NOT_NULL(p_size);\n+\n+ const uint32_t available_count = p_fifo->buf_size_mask - fifo_length(p_fifo) + 1;\n+ const uint32_t requested_len = (*p_size);\n+ uint32_t index = 0;\n+ uint32_t write_size = MIN(requested_len, available_count);\n+\n+ (*p_size) = available_count;\n+\n+ // Check if the FIFO is FULL.\n+ if (available_count == 0)\n+ {\n+ return NRF_ERROR_NO_MEM;\n+ }\n+\n+ // Check if application has requested only the size.\n+ if (p_byte_array == NULL)\n+ {\n+ return NRF_SUCCESS;\n+ }\n+\n+ //Fetch bytes from the FIFO.\n+ while (index < write_size)\n+ {\n+ fifo_put(p_fifo, p_byte_array[index++]);\n+ }\n+\n+ (*p_size) = write_size;\n+\n+ return NRF_SUCCESS;\n+}\n+#endif //NRF_MODULE_ENABLED(APP_FIFO)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "bsp/boards/nrf52840/sdk/components/libraries/fifo/app_fifo.h",
"diff": "+/**\n+ * Copyright (c) 2013 - 2018, Nordic Semiconductor ASA\n+ *\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without modification,\n+ * are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice, this\n+ * list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form, except as embedded into a Nordic\n+ * Semiconductor ASA integrated circuit in a product or a software update for\n+ * such product, must reproduce the above copyright notice, this list of\n+ * conditions and the following disclaimer in the documentation and/or other\n+ * materials provided with the distribution.\n+ *\n+ * 3. Neither the name of Nordic Semiconductor ASA nor the names of its\n+ * contributors may be used to endorse or promote products derived from this\n+ * software without specific prior written permission.\n+ *\n+ * 4. This software, with or without modification, must only be used with a\n+ * Nordic Semiconductor ASA integrated circuit.\n+ *\n+ * 5. Any software provided in binary form under this license must not be reverse\n+ * engineered, decompiled, modified and/or disassembled.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA \"AS IS\" AND ANY EXPRESS\n+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n+ * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ */\n+/**@file\n+ *\n+ * @defgroup app_fifo FIFO implementation\n+ * @{\n+ * @ingroup app_common\n+ *\n+ * @brief FIFO implementation.\n+ */\n+\n+#ifndef APP_FIFO_H__\n+#define APP_FIFO_H__\n+\n+#include <stdint.h>\n+#include <stdlib.h>\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**@brief A FIFO instance structure.\n+ * @details Keeps track of which bytes to read and write next.\n+ * Also, it keeps the information about which memory is allocated for the buffer\n+ * and its size. This structure must be initialized by app_fifo_init() before use.\n+ */\n+typedef struct\n+{\n+ uint8_t * p_buf; /**< Pointer to FIFO buffer memory. */\n+ uint16_t buf_size_mask; /**< Read/write index mask. Also used for size checking. */\n+ volatile uint32_t read_pos; /**< Next read position in the FIFO buffer. */\n+ volatile uint32_t write_pos; /**< Next write position in the FIFO buffer. */\n+} app_fifo_t;\n+\n+/**@brief Function for initializing the FIFO.\n+ *\n+ * @param[out] p_fifo FIFO object.\n+ * @param[in] p_buf FIFO buffer for storing data. The buffer size must be a power of two.\n+ * @param[in] buf_size Size of the FIFO buffer provided. This size must be a power of two.\n+ *\n+ * @retval NRF_SUCCESS If initialization was successful.\n+ * @retval NRF_ERROR_NULL If a NULL pointer is provided as buffer.\n+ * @retval NRF_ERROR_INVALID_LENGTH If size of buffer provided is not a power of two.\n+ */\n+uint32_t app_fifo_init(app_fifo_t * p_fifo, uint8_t * p_buf, uint16_t buf_size);\n+\n+/**@brief Function for adding an element to the FIFO.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO.\n+ * @param[in] byte Data byte to add to the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If an element has been successfully added to the FIFO.\n+ * @retval NRF_ERROR_NO_MEM If the FIFO is full.\n+ */\n+uint32_t app_fifo_put(app_fifo_t * p_fifo, uint8_t byte);\n+\n+/**@brief Function for getting the next element from the FIFO.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO.\n+ * @param[out] p_byte Byte fetched from the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If an element was returned.\n+ * @retval NRF_ERROR_NOT_FOUND If there are no more elements in the queue.\n+ */\n+uint32_t app_fifo_get(app_fifo_t * p_fifo, uint8_t * p_byte);\n+\n+/**@brief Function for looking at an element in the FIFO, without consuming it.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO.\n+ * @param[in] index Which element to look at. The lower the index, the earlier it was put.\n+ * @param[out] p_byte Byte fetched from the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If an element was returned.\n+ * @retval NRF_ERROR_NOT_FOUND If there are no more elements in the queue, or the index was\n+ * too large.\n+ */\n+uint32_t app_fifo_peek(app_fifo_t * p_fifo, uint16_t index, uint8_t * p_byte);\n+\n+/**@brief Function for flushing the FIFO.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If the FIFO was flushed successfully.\n+ */\n+uint32_t app_fifo_flush(app_fifo_t * p_fifo);\n+\n+/**@brief Function for reading bytes from the FIFO.\n+ *\n+ * This function can also be used to get the number of bytes in the FIFO.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO. Must not be NULL.\n+ * @param[out] p_byte_array Memory pointer where the read bytes are fetched from the FIFO.\n+ * Can be NULL. If NULL, the number of bytes that can be read in the FIFO\n+ * are returned in the p_size parameter.\n+ * @param[inout] p_size Address to memory indicating the maximum number of bytes to be read.\n+ * The provided memory is overwritten with the actual number of bytes\n+ * read if the procedure was successful. This field must not be NULL.\n+ * If p_byte_array is set to NULL by the application, this parameter\n+ * returns the number of bytes in the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If the procedure is successful. The actual number of bytes read might\n+ * be less than the requested maximum, depending on how many elements exist\n+ * in the FIFO. Even if less bytes are returned, the procedure is considered\n+ * successful.\n+ * @retval NRF_ERROR_NULL If a NULL parameter was passed for a parameter that must not\n+ * be NULL.\n+ * @retval NRF_ERROR_NOT_FOUND If the FIFO is empty.\n+ */\n+uint32_t app_fifo_read(app_fifo_t * p_fifo, uint8_t * p_byte_array, uint32_t * p_size);\n+\n+/**@brief Function for writing bytes to the FIFO.\n+ *\n+ * This function can also be used to get the available size on the FIFO.\n+ *\n+ * @param[in] p_fifo Pointer to the FIFO. Must not be NULL.\n+ * @param[in] p_byte_array Memory pointer containing the bytes to be written to the FIFO.\n+ * Can be NULL. If NULL, this function returns the number of bytes\n+ * that can be written to the FIFO.\n+ * @param[inout] p_size Address to memory indicating the maximum number of bytes to be written.\n+ * The provided memory is overwritten with the number of bytes that were actually\n+ * written if the procedure is successful. This field must not be NULL.\n+ * If p_byte_array is set to NULL by the application, this parameter\n+ * returns the number of bytes available in the FIFO.\n+ *\n+ * @retval NRF_SUCCESS If the procedure is successful. The actual number of bytes written might\n+ * be less than the requested maximum, depending on how much room there is in\n+ * the FIFO. Even if less bytes are written, the procedure is considered\n+ * successful. If the write was partial, the application should use\n+ * subsequent calls to attempt writing the data again.\n+ * @retval NRF_ERROR_NULL If a NULL parameter was passed for a parameter that must not\n+ * be NULL.\n+ * @retval NRF_ERROR_NO_MEM If the FIFO is full.\n+ *\n+ */\n+uint32_t app_fifo_write(app_fifo_t * p_fifo, uint8_t const * p_byte_array, uint32_t * p_size);\n+\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif // APP_FIFO_H__\n+\n+/** @} */\n"
},
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840/uart.c",
"new_path": "bsp/boards/nrf52840/uart.c",
"diff": "#include \"sdk/components/boards/boards.h\"\n#include \"sdk/components/libraries/uart/app_uart.h\"\n+#include \"sdk/modules/nrfx/hal/nrf_uart.h\"\n+#include \"sdk/integration/nrfx/legacy/nrf_drv_clock.h\"\n+#include \"sdk/modules/nrfx/drivers/include/nrfx_systick.h\"\n#include \"board.h\"\n#include \"leds.h\"\n@@ -47,15 +50,7 @@ static void uart_event_handler(app_uart_evt_t * p_event);\n//=========================== public ==========================================\n-void uart_init(void)\n-{\n- // reset local variables\n- memset(&uart_vars,0,sizeof(uart_vars_t));\n-\n- // for the case that the UART has previously been initialized, uninitialize it first\n- app_uart_close();\n-\n- app_uart_comm_params_t const app_config =\n+static app_uart_comm_params_t const app_config =\n{\n.rx_pin_no= RX_PIN_NUMBER,\n.tx_pin_no= TX_PIN_NUMBER,\n@@ -66,14 +61,52 @@ void uart_init(void)\n.flow_control= UART_DEFAULT_CONFIG_HWFC // defaults to false\n};\n+static void uart_reinit(void)\n+{\n+ // for the case that the UART has previously been initialized, uninitialize it first\n+ app_uart_close();\n+\n+ #define APP_UART_BUF_SIZE 128\n+\n+ static uint8_t rx_buf[APP_UART_BUF_SIZE];\n+ static uint8_t tx_buf[APP_UART_BUF_SIZE];\n+ static app_uart_buffers_t app_uart_buffers=\n+ {\n+ .rx_buf= rx_buf,\n+ .tx_buf= tx_buf,\n+ .rx_buf_size= sizeof(rx_buf),\n+ .tx_buf_size= sizeof(tx_buf)\n+ };\n+\n+ memset(rx_buf, 0, sizeof(rx_buf));\n+ memset(tx_buf, 0, sizeof(tx_buf));\n+\n// if UART cannot be initialized, blink error LED for 10s, and then reset\n- if (NRF_SUCCESS != app_uart_init(&app_config, NULL, uart_event_handler, (app_irq_priority_t) NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY))\n+ if (NRF_SUCCESS != app_uart_init(&app_config, &app_uart_buffers, uart_event_handler, (app_irq_priority_t) NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY))\n{\nleds_error_blink();\nboard_reset();\n}\n}\n+void uart_init(void)\n+{\n+ // reset local variables\n+ memset(&uart_vars,0,sizeof(uart_vars_t));\n+\n+ // UART baudrate accuracy depends on HFCLK\n+ // see radio.c for details on enabling HFCLK\n+ #define hfclk_request_timeout_us 380\n+ {\n+ nrfx_systick_state_t systick_time;\n+ nrfx_systick_get(&systick_time);\n+ nrf_drv_clock_hfclk_request(NULL);\n+ while ((!nrf_drv_clock_hfclk_is_running()) && (!nrfx_systick_test(&systick_time, hfclk_request_timeout_us))) {}\n+ }\n+\n+ uart_reinit();\n+}\n+\nvoid uart_setCallbacks(uart_tx_cbt txCb, uart_rx_cbt rxCb)\n{\nuart_vars.txCb = txCb;\n@@ -118,11 +151,12 @@ void uart_event_handler(app_uart_evt_t * p_event)\n{\n// debugpins_isr_set();\n- if ((p_event->evt_type == APP_UART_COMMUNICATION_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR))\n+ if ((p_event->evt_type == APP_UART_COMMUNICATION_ERROR) || (p_event->evt_type == APP_UART_FIFO_ERROR))\n{\n// handle error ...\n// leds_error_blink();\nleds_error_toggle();\n+ uart_reinit();\n}\nelse if ((p_event->evt_type == APP_UART_DATA) || (p_event->evt_type == APP_UART_DATA_READY))\n{\n@@ -163,4 +197,8 @@ kick_scheduler_t uart_rx_isr(void)\nreturn DO_NOT_KICK_SCHEDULER;\n}\n+void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)\n+{\n+ // handle error ...\n+}\n#endif // UART_DISABLED\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Fixed the problem of UART dropping received characters by utilizing a FIFO.
|
491,595 |
18.10.2018 15:54:04
| -7,200 |
dd0585e810276f57ea4984d0c34bf470738f3559
|
no need using ackReply.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -48,7 +48,6 @@ owerror_t openserial_printInfoErrorCritical(\nerrorparameter_t arg1,\nerrorparameter_t arg2\n);\n-owerror_t openserial_ackReply(void);\n// command handlers\nvoid openserial_handleRxFrame(void);\n@@ -251,21 +250,6 @@ owerror_t openserial_printSniffedPacket(uint8_t* buffer, uint8_t length, uint8_t\nreturn E_SUCCESS;\n}\n-\n-owerror_t openserial_ackReply(void) {\n-\n- outputHdlcOpen();\n- outputHdlcWrite(SERFRAME_MOTE2PC_ACKREPLY);\n- outputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[0]);\n- outputHdlcWrite(idmanager_getMyID(ADDR_16B)->addr_16b[1]);\n- outputHdlcClose();\n-\n- // start TX'ing\n- openserial_flush();\n-\n- return E_SUCCESS;\n-}\n-\nowerror_t openserial_print_uint32_t(uint32_t value) {\n#ifdef OPENSERIAL_PRINTF\nuint8_t i;\n@@ -589,14 +573,12 @@ void openserial_handleRxFrame() {\nswitch (cmdByte) {\ncase SERFRAME_PC2MOTE_SETROOT:\nidmanager_triggerAboutRoot();\n- openserial_ackReply();\nbreak;\ncase SERFRAME_PC2MOTE_RESET:\nboard_reset();\nbreak;\ncase SERFRAME_PC2MOTE_DATA:\nopenbridge_triggerData();\n- openserial_ackReply();\nbreak;\ncase SERFRAME_PC2MOTE_TRIGGERSERIALECHO:\nopenserial_handleEcho(\n@@ -605,7 +587,6 @@ void openserial_handleRxFrame() {\n);\nbreak;\ncase SERFRAME_PC2MOTE_COMMAND:\n- openserial_ackReply();\nopenserial_handleCommands();\nbreak;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -407,7 +407,6 @@ functionsToChange = [\n'openserial_printInfo',\n'openserial_printError',\n'openserial_printCritical',\n- 'openserial_ackReply',\n'task_openserial_debugPrint',\n'task_printInputBufferOverflow',\n'task_printWrongCRCInput',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
OV-6. no need using ackReply.
|
491,595 |
18.10.2018 15:58:15
| -7,200 |
8d888d9abb990fdc6ab22140cf4d50af98c9e602
|
remove ACKreply type serial command
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "#define SERFRAME_MOTE2PC_CRITICAL ((uint8_t)'C')\n#define SERFRAME_MOTE2PC_SNIFFED_PACKET ((uint8_t)'P')\n#define SERFRAME_MOTE2PC_PRINTF ((uint8_t)'F')\n-#define SERFRAME_MOTE2PC_ACKREPLY ((uint8_t)'A')\n// frames sent PC->mote\n#define SERFRAME_PC2MOTE_SETROOT ((uint8_t)'R')\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
OV-6. remove ACKreply type serial command
|
491,595 |
18.10.2018 18:03:38
| -7,200 |
c0275696ab85597e031705ecec1831d7fe58b8bd
|
remove serialRx cells.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n#define OPENWSN_VERSION_MINOR 21\n-#define OPENWSN_VERSION_PATCH 1\n+#define OPENWSN_VERSION_PATCH 2\n#ifndef TRUE\n#define TRUE 1\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -1088,56 +1088,6 @@ port_INLINE void activity_ti1ORri1(void) {\n// radiotimer_schedule(DURATION_rt1);\n#endif\nbreak;\n- case CELLTYPE_SERIALRX:\n-\n- // this is to emulate a set of serial input slots without having the slotted structure.\n-\n- // skip the serial rx slots\n- ieee154e_vars.numOfSleepSlots = NUMSERIALRX;\n-\n- //increase ASN by NUMSERIALRX-1 slots as at this slot is already incremented by 1\n- for (i=0;i<NUMSERIALRX-1;i++){\n- incrementAsnOffset();\n- // advance the schedule\n- schedule_advanceSlot();\n- // find the next one\n- ieee154e_vars.nextActiveSlotOffset = schedule_getNextActiveSlotOffset();\n- }\n- // possibly skip additional slots if enabled\n- if (idmanager_getIsSlotSkip() && idmanager_getIsDAGroot()==FALSE) {\n- if (ieee154e_vars.nextActiveSlotOffset>ieee154e_vars.slotOffset) {\n- ieee154e_vars.numOfSleepSlots = ieee154e_vars.nextActiveSlotOffset-ieee154e_vars.slotOffset+NUMSERIALRX-1;\n- } else {\n- ieee154e_vars.numOfSleepSlots = schedule_getFrameLength()+ieee154e_vars.nextActiveSlotOffset-ieee154e_vars.slotOffset+NUMSERIALRX-1;\n- }\n-\n- //only increase ASN by numOfSleepSlots-NUMSERIALRX\n- for (i=0;i<ieee154e_vars.numOfSleepSlots-NUMSERIALRX;i++){\n- incrementAsnOffset();\n- }\n- }\n- // set the timer based on calcualted number of slots to skip\n- opentimers_scheduleAbsolute(\n- ieee154e_vars.timerId, // timerId\n- TsSlotDuration*(ieee154e_vars.numOfSleepSlots), // duration\n- ieee154e_vars.startOfSlotReference, // reference\n- TIME_TICS, // timetype\n- isr_ieee154e_newSlot // callback\n- );\n- ieee154e_vars.slotDuration = TsSlotDuration*(ieee154e_vars.numOfSleepSlots);\n- // radiotimer_setPeriod(TsSlotDuration*(ieee154e_vars.numOfSleepSlots));\n-\n-#ifdef ADAPTIVE_SYNC\n- // deal with the case when schedule multi slots\n- adaptive_sync_countCompensationTimeout_compoundSlots(NUMSERIALRX-1);\n-#endif\n- // abort the slot\n- endSlot();\n-\n- break;\n- case CELLTYPE_MORESERIALRX:\n- // do nothing (not even endSlot())\n- break;\ndefault:\n// log the error\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -92,9 +92,7 @@ typedef enum {\nCELLTYPE_OFF = 0,\nCELLTYPE_TX = 1,\nCELLTYPE_RX = 2,\n- CELLTYPE_TXRX = 3,\n- CELLTYPE_SERIALRX = 4,\n- CELLTYPE_MORESERIALRX = 5\n+ CELLTYPE_TXRX = 3\n} cellType_t;\ntypedef struct {\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-540. remove serialRx cells.
|
491,595 |
22.10.2018 18:34:59
| -7,200 |
5e013b8e20ec8b3187c089baeeb5925ecf596841
|
correct the image name.
|
[
{
"change_type": "MODIFY",
"old_path": "bootloader/openmote-cc2538/ot_program.py",
"new_path": "bootloader/openmote-cc2538/ot_program.py",
"diff": "@@ -5,6 +5,7 @@ import time\nimport sys, getopt\nimport Queue\nimport random\n+import os\n#============================ defines =========================================\nBROKER_ADDRESS = \"argus.paris.inria.fr\"\n@@ -27,6 +28,9 @@ class program_over_testbed(object):\nself.image_name = ''\nwith open(image_path,'rb') as f:\nself.image = base64.b64encode(f.read())\n+ if os.name=='nt': # Windows\n+ self.image_name = image_path.split('\\\\')[-1]\n+ elif os.name=='posix': # Linux\nself.image_name = image_path.split('/')[-1]\n# initialize statistic result\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. correct the image name.
|
491,595 |
22.10.2018 18:37:37
| -7,200 |
5066664df5db22fed87d2628a9db691d7cb18e7c
|
use opentestbed instead of testbed.
|
[
{
"change_type": "MODIFY",
"old_path": "SConscript",
"new_path": "SConscript",
"diff": "@@ -690,7 +690,7 @@ class opentestbed_bootloadThread(threading.Thread):\ndef run(self):\nprint 'starting bootloading on {0}'.format(self.mote)\n- if self.mote == 'testbed':\n+ if self.mote == 'opentestbed':\ntarget = 'all'\nelse:\ntarget = self.mote\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-773. use opentestbed instead of testbed.
|
491,605 |
25.10.2018 11:02:58
| -7,200 |
7fc31f5b9cdf16bb3b834b337276b7c20aaca600
|
Added 20ms slot duration case.
|
[
{
"change_type": "MODIFY",
"old_path": "bsp/boards/nrf52840/board_info.h",
"new_path": "bsp/boards/nrf52840/board_info.h",
"diff": "//===== IEEE802154E timing\n// 1 clock tick = 30.5 us\n-#define SLOTDURATION 15 // in miliseconds\n+#define SLOTDURATION 20 // in miliseconds\n#if SLOTDURATION==10\n// time-slot related\n#endif // SLOTDURATION==15\n+#if SLOTDURATION==20\n+ // time-slot related\n+ #define PORT_TsSlotDuration 656 // counter counts one extra count, see datasheet\n+\n+#if BOARD_PCA10056\n+// nrf52840-DK\n+ #define PORT_maxTxDataPrepare 13 // ~397us (measured 364us)\n+ #define PORT_maxRxAckPrepare 13 // ~397us (measured 364us)\n+ #define PORT_maxRxDataPrepare 13 // ~397us (measured 364us)\n+ #define PORT_maxTxAckPrepare 13 // ~397us (measured 364us)\n+\n+ // radio speed related\n+ #define PORT_delayTx 10 // 305us (measured 282us; radio_txNow() to RADIO_IRQHandler() / NRF_RADIO->EVENTS_READY)\n+ #define PORT_delayRx 5 // ~153us (measured 147us; radio_rxNow() to RADIO_IRQHandler() / NRF_RADIO->EVENTS_READY)\n+#endif\n+#if BOARD_PCA10059\n+// nrf52840-DONGLE\n+ #define PORT_maxTxDataPrepare 13 // ~397us (measured 345us)\n+ #define PORT_maxRxAckPrepare 13 // ~397us (measured 345us)\n+ #define PORT_maxRxDataPrepare 13 // ~397us (measured 345us)\n+ #define PORT_maxTxAckPrepare 13 // ~397us (measured 345us)\n+\n+ // radio speed related\n+ #define PORT_delayTx 10 // 305us (measured 282us; radio_txNow() to RADIO_IRQHandler() / NRF_RADIO->EVENTS_READY)\n+ #define PORT_delayRx 5 // ~153us (measured 136us; radio_rxNow() to RADIO_IRQHandler() / NRF_RADIO->EVENTS_READY)\n+#endif\n+\n+#endif // SLOTDURATION==20\n+\n//===== adaptive_sync accuracy\n#define SYNC_ACCURACY 1 // ticks\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Added 20ms slot duration case.
|
491,605 |
25.10.2018 11:03:45
| -7,200 |
447329ced1145aef383e9a120f99278df5d45697
|
Updated SES project files (beautification)
|
[
{
"change_type": "MODIFY",
"old_path": "projects/nrf52840/02drv_opentimers/NordicOpenWSN_02drv_opentimers_DK.emProject",
"new_path": "projects/nrf52840/02drv_opentimers/NordicOpenWSN_02drv_opentimers_DK.emProject",
"diff": "project_type=\"Executable\" />\n<folder Name=\"Application\">\n<file file_name=\"../../../bsp/boards/nrf52840/app_config.h\" />\n- <file file_name=\"../../../projects/common/02drv_opentimers/02drv_opentimers.c\" />\n+ <file file_name=\"drv_opentimers.c\" />\n</folder>\n<folder Name=\"Segger ES Specific\">\n<file file_name=\"../../../bsp/boards/nrf52840/sdk/modules/nrfx/mdk/ses_nRF_Startup.s\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/nrf52840/03oos_openwsn/NordicOpenWSN_03oos_openwsn_DONGLE.emProject",
"new_path": "projects/nrf52840/03oos_openwsn/NordicOpenWSN_03oos_openwsn_DONGLE.emProject",
"diff": "arm_simulator_memory_simulation_parameter=\"RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD\"\narm_target_device_name=\"nRF52840_xxAA\"\narm_target_interface_type=\"SWD\"\n- c_preprocessor_definitions=\"BSP_DEFINES_ONLY;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;ARM_MATH_CM4;__FPU_PRESENT=1;USE_APP_CONFIG=1;NRF52840_XXAA=1;BOARD_PCA10059=1;CONFIG_GPIO_AS_PINRESET=1;DAGROOT=1\"\n+ c_preprocessor_definitions=\"BSP_DEFINES_ONLY;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;ARM_MATH_CM4;__FPU_PRESENT=1;USE_APP_CONFIG=1;NRF52840_XXAA=1;BOARD_PCA10059=1;CONFIG_GPIO_AS_PINRESET=1\"\nc_user_include_directories=\"../../../drivers/common;../../../inc;../../../kernel;../../../openapps;../../../openapps/c6t;../../../openapps/cinfo;../../../openapps/cjoin;../../../openapps/cleds;../../../openapps/cwellknown;../../../openapps/opencoap;../../../openapps/rrt;../../../openapps/uecho;../../../openapps/uexpiration;../../../openapps/uexpiration_monitor;../../../openapps/uinject;../../../openapps/userialbridge;../../../openstack;../../../openstack/02a-MAClow;../../../openstack/02b-MAChigh;../../../openstack/03a-IPHC;../../../openstack/03b-IPv6;../../../openstack/04-TRAN;../../../openstack/cross-layers;../../../bsp/boards/nrf52840;../../../bsp/boards/nrf52840/sdk/config/nrf52840/config;../../../bsp/boards/nrf52840/sdk/integration/nrfx;../../../bsp/boards/nrf52840/sdk/components/toolchain/cmsis/include;../../../bsp/boards/nrf52840/sdk/components/drivers_nrf/nrf_soc_nosd;../../../bsp/boards/nrf52840/sdk/components/libraries/atomic;../../../bsp/boards/nrf52840/sdk/components/libraries/balloc;../../../bsp/boards/nrf52840/sdk/components/libraries/delay;../../../bsp/boards/nrf52840/sdk/components/libraries/experimental_log;../../../bsp/boards/nrf52840/sdk/components/libraries/experimental_log/src;../../../bsp/boards/nrf52840/sdk/components/libraries/experimental_memobj;../../../bsp/boards/nrf52840/sdk/components/libraries/experimental_section_vars;../../../bsp/boards/nrf52840/sdk/components/libraries/mutex;../../../bsp/boards/nrf52840/sdk/components/libraries/strerror;../../../bsp/boards/nrf52840/sdk/components/libraries/uart;../../../bsp/boards/nrf52840/sdk/components/libraries/util;../../../bsp/boards/nrf52840/sdk/integration/nrfx/legacy;../../../bsp/boards/nrf52840/sdk/modules/nrfx;../../../bsp/boards/nrf52840/sdk/modules/nrfx/drivers;../../../bsp/boards/nrf52840/sdk/modules/nrfx/drivers/include;../../../bsp/boards/nrf52840/sdk/modules/nrfx/drivers/src;../../../bsp/boards/nrf52840/sdk/modules/nrfx/drivers/src/prs;../../../bsp/boards/nrf52840/sdk/modules/nrfx/hal;../../../bsp/boards/nrf52840/sdk/modules/nrfx/mdk;../../../bsp/boards/nrf52840/sdk/modules/nrfx/soc;../../../bsp/boards/nrf52840/sdk/modules/nrfx/templates;../../../bsp/boards/nrf52840/sdk/components/drivers_nrf/radio_config;../../../bsp/boards\"\ndebug_register_definition_file=\"../../../bsp/boards/nrf52840/sdk/modules/nrfx/mdk/nrf52840.svd\"\ndebug_start_from_entry_point_symbol=\"No\"\n<configuration Name=\"Debug\" build_exclude_from_build=\"Yes\" />\n</file>\n<file file_name=\"../../../openapps/uinject/uinject.c\">\n- <configuration Name=\"Debug\" build_exclude_from_build=\"Yes\" />\n+ <configuration Name=\"Debug\" build_exclude_from_build=\"No\" />\n</file>\n<file file_name=\"../../../openapps/userialbridge/userialbridge.c\">\n<configuration Name=\"Debug\" build_exclude_from_build=\"Yes\" />\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
Updated SES project files (beautification)
|
491,595 |
26.10.2018 21:15:42
| -7,200 |
a79644bf4313d44f5b7640c091a3f75cb768c301
|
Send debug info every slot.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n#define OPENWSN_VERSION_MINOR 21\n-#define OPENWSN_VERSION_PATCH 3\n+#define OPENWSN_VERSION_PATCH 4\n#ifndef TRUE\n#define TRUE 1\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -614,9 +614,7 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// increment dummy ASN to trigger debugprint every now and then\nieee154e_vars.asn.bytes0and1++;\n- if ( (ieee154e_vars.asn.bytes0and1&0x000f) ==0x0000) {\nscheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n- }\nopentimers_scheduleAbsolute(\nieee154e_vars.serialInhibitTimerId, // timerId\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. Send debug info every slot.
|
491,595 |
26.10.2018 21:19:17
| -7,200 |
16980a6833722fa23fed71bfd4e9332f59d583e7
|
should be version 3.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n#define OPENWSN_VERSION_MINOR 21\n-#define OPENWSN_VERSION_PATCH 4\n+#define OPENWSN_VERSION_PATCH 3\n#ifndef TRUE\n#define TRUE 1\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. should be version 3.
|
491,595 |
31.10.2018 11:26:31
| -3,600 |
8215d44c0153ec60c4645e8f7a0cd91881537e03
|
debugPrint function of openserial should be only called inside of openserial.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -37,6 +37,9 @@ enum{\nTYPE_STR = 0, //subtype for the printf message\nTYPE_INT = 1\n};\n+\n+#define DEBUGPRINT_PERIOD 100 // in ms\n+\n//=========================== prototypes ======================================\n@@ -56,6 +59,7 @@ void openserial_get6pInfo(uint8_t commandId, uint8_t* code,uint8_t* cellOptions,\nvoid openserial_handleCommands(void);\n// misc\n+void openserial_debugPrint_timer_cb(opentimers_id_t id);\nvoid openserial_board_reset_cb(opentimers_id_t id);\n// HDLC output\n@@ -95,6 +99,15 @@ void openserial_init(void) {\nopenserial_vars.outputBufIdxW = 0;\nopenserial_vars.fBusyFlushing = FALSE;\n+ openserial_vars.debugPrint_timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\n+ opentimers_scheduleIn(\n+ openserial_vars.debugPrint_timerId,\n+ DEBUGPRINT_PERIOD,\n+ TIME_MS,\n+ TIMER_PERIODIC,\n+ openserial_debugPrint_timer_cb\n+ );\n+\n// UART\nuart_setCallbacks(\nisr_openserial_tx,\n@@ -846,6 +859,10 @@ void openserial_handleCommands(void){\n//===== misc\n+void openserial_debugPrint_timer_cb(opentimers_id_t id){\n+ scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n+}\n+\nvoid openserial_board_reset_cb(opentimers_id_t id) {\n(void)id;\nboard_reset();\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "#ifndef __OPENSERIAL_H\n#define __OPENSERIAL_H\n-#include \"opendefs.h\"\n+#include \"opentimers.h\"\n#include <stdio.h>\n#include <stdarg.h>\n@@ -101,6 +101,7 @@ typedef struct {\nuint8_t ctsStateChanged;\nuint8_t debugPrintCounter;\nopenserial_rsvpt* registeredCmd;\n+ opentimers_id_t debugPrint_timerId;\n// input\nuint8_t inputBuf[SERIAL_INPUT_BUFFER_SIZE];\nuint8_t inputBufFillLevel;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -614,7 +614,6 @@ port_INLINE void activity_synchronize_newSlot(void) {\n// increment dummy ASN to trigger debugprint every now and then\nieee154e_vars.asn.bytes0and1++;\n- scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\nopentimers_scheduleAbsolute(\nieee154e_vars.serialInhibitTimerId, // timerId\n@@ -934,9 +933,6 @@ port_INLINE void activity_ti1ORri1(void) {\n} else {\n// this is NOT the next active slot, abort\n- // trigger debug prints\n- scheduler_push_task(task_openserial_debugPrint,TASKPRIO_OPENSERIAL);\n-\n// abort the slot\nendSlot();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/openstack.c",
"new_path": "openstack/openstack.c",
"diff": "#include \"openqueue.h\"\n#include \"openrandom.h\"\n#include \"opentimers.h\"\n-#include \"opentimers.h\"\n//-- 02a-TSCH\n#include \"adaptive_sync.h\"\n#include \"IEEE802154E.h\"\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -412,6 +412,7 @@ functionsToChange = [\n'task_printWrongCRCInput',\n'openserial_print_str',\n'openserial_print_uint32_t',\n+ 'openserial_debugPrint_timer_cb',\n'openserial_board_reset_cb',\n'openserial_getInputBufferFillLevel',\n'openserial_getInputBuffer',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-785. debugPrint function of openserial should be only called inside of openserial.
|
491,595 |
31.10.2018 14:45:32
| -3,600 |
60ac16a0c2103c7ab80dc5baf3da6cbe72d8df94
|
opentimers should be initialized before openserial.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/openstack.c",
"new_path": "openstack/openstack.c",
"diff": "void openstack_init(void) {\n//===== drivers\n+ opentimers_init();\nopenserial_init();\n//===== stack\n@@ -53,7 +54,7 @@ void openstack_init(void) {\nidmanager_init(); // call first since initializes EUI64 and isDAGroot\nopenqueue_init();\nopenrandom_init();\n- opentimers_init();\n+\n//-- 02a-TSCH\n// adaptive_sync_init();\nieee154e_init();\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-785. opentimers should be initialized before openserial.
|
491,595 |
31.10.2018 14:48:46
| -3,600 |
8707580fb2a43113a44d3f426378cbe084cf0409
|
fix simulation compilation.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "#ifndef __OPENSERIAL_H\n#define __OPENSERIAL_H\n-#include \"opentimers.h\"\n+#include \"opendefs.h\"\n#include <stdio.h>\n#include <stdarg.h>\n@@ -101,7 +101,7 @@ typedef struct {\nuint8_t ctsStateChanged;\nuint8_t debugPrintCounter;\nopenserial_rsvpt* registeredCmd;\n- opentimers_id_t debugPrint_timerId;\n+ uint8_t debugPrint_timerId;\n// input\nuint8_t inputBuf[SERIAL_INPUT_BUFFER_SIZE];\nuint8_t inputBufFillLevel;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-785. fix simulation compilation.
|
491,595 |
02.11.2018 11:57:24
| -3,600 |
9b524b9c9da2f7151dbeb8cb7b432e48f417b77d
|
log time correction only when it's larger than LIMITLARGETIMECORRECTION.
|
[
{
"change_type": "MODIFY",
"old_path": "inc/opendefs.h",
"new_path": "inc/opendefs.h",
"diff": "static const uint8_t infoStackName[] = \"OpenWSN \";\n#define OPENWSN_VERSION_MAJOR 1\n#define OPENWSN_VERSION_MINOR 21\n-#define OPENWSN_VERSION_PATCH 3\n+#define OPENWSN_VERSION_PATCH 4\n#ifndef TRUE\n#define TRUE 1\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -2617,7 +2617,11 @@ void synchronizePacket(PORT_TIMER_WIDTH timeReceived) {\n// log a large timeCorrection\nif (\n- ieee154e_vars.isSync==TRUE\n+ ieee154e_vars.isSync==TRUE &&\n+ (\n+ timeCorrection<-LIMITLARGETIMECORRECTION ||\n+ timeCorrection> LIMITLARGETIMECORRECTION\n+ )\n) {\nopenserial_printError(COMPONENT_IEEE802154E,ERR_LARGE_TIMECORRECTION,\n(errorparameter_t)timeCorrection,\n@@ -2661,7 +2665,11 @@ void synchronizeAck(PORT_SIGNED_INT_WIDTH timeCorrection) {\n#endif\n// log a large timeCorrection\nif (\n- ieee154e_vars.isSync==TRUE\n+ ieee154e_vars.isSync==TRUE &&\n+ (\n+ timeCorrection<-LIMITLARGETIMECORRECTION ||\n+ timeCorrection> LIMITLARGETIMECORRECTION\n+ )\n) {\nopenserial_printError(COMPONENT_IEEE802154E,ERR_LARGE_TIMECORRECTION,\n(errorparameter_t)timeCorrection,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-786. log time correction only when it's larger than LIMITLARGETIMECORRECTION.
|
491,595 |
05.11.2018 12:01:22
| -3,600 |
aaafd6d4d593d5411d452b944d919745a4f202f1
|
add automous rx cell for each motes.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -37,6 +37,7 @@ void msf_housekeeping(void);\n//=========================== public ==========================================\nvoid msf_init(void) {\n+\nmemset(&msf_vars,0,sizeof(msf_vars_t));\nmsf_vars.numAppPacketsPerSlotFrame = 0;\nsixtop_setSFcallback(\n@@ -45,6 +46,15 @@ void msf_init(void) {\n(sixtop_sf_translatemetadata)msf_translateMetadata,\n(sixtop_sf_handle_callback)msf_handleRCError\n);\n+\n+ schedule_addActiveSlot(\n+ msf_hashFunction_getSlotoffset(), // slot offset\n+ CELLTYPE_RX, // type of slot\n+ FALSE, // shared?\n+ msf_hashFunction_getChanneloffset(), // channel offset\n+ idmanager_getMyID(ADDR_64B) // neighbor\n+ );\n+\nmsf_vars.housekeepingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nmsf_vars.housekeepingPeriod = HOUSEKEEPING_PERIOD;\nopentimers_scheduleIn(\n@@ -171,6 +181,8 @@ void msf_timer_housekeeping_cb(opentimers_id_t id){\nopentimers_updateDuration(msf_vars.housekeepingTimerId, newDuration);\n}\n+//=========================== tasks ============================================\n+\nvoid msf_timer_housekeeping_task(void){\nmsf_housekeeping();\n@@ -388,3 +400,24 @@ void msf_housekeeping(void){\n);\n}\n}\n+\n+uint16_t msf_hashFunction_getSlotoffset(void){\n+\n+ uint16_t moteId;\n+\n+ moteId = 256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+\\\n+ idmanager_getMyID(ADDR_64B)->addr_64b[7];\n+\n+ return SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS + \\\n+ (moteId%(SLOTFRAME_LENGTH-SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS));\n+}\n+\n+uint8_t msf_hashFunction_getChanneloffset(void){\n+\n+ uint16_t moteId;\n+\n+ moteId = 256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+\\\n+ idmanager_getMyID(ADDR_64B)->addr_64b[7];\n+\n+ return moteId%NUM_CHANNELS;\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "@@ -60,6 +60,9 @@ void msf_updateCellsPassed(open_addr_t* neighbor);\nvoid msf_updateCellsUsed(open_addr_t* neighbor);\n// called by icmpv6rpl, where parent changed\nvoid msf_trigger6pClear(open_addr_t* neighbor);\n+\n+uint16_t msf_hashFunction_getSlotoffset(void);\n+uint8_t msf_hashFunction_getChanneloffset(void);\n/**\n\\}\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -651,6 +651,8 @@ functionsToChange = [\n'msf_trigger6pClear',\n'msf_updateCellsPassed',\n'msf_updateCellsUsed',\n+ 'msf_hashFunction_getSlotoffset',\n+ 'msf_hashFunction_getChanneloffset',\n# sixtop\n'sixtop_init',\n'sixtop_setKaPeriod',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. add automous rx cell for each motes.
|
491,595 |
05.11.2018 16:18:08
| -3,600 |
04311eae009f7651093cacb877502c68d8f155ca
|
add autonomous tx cell when new neighbor is found and remove the cell when neighbor is removed.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -48,10 +48,10 @@ void msf_init(void) {\n);\nschedule_addActiveSlot(\n- msf_hashFunction_getSlotoffset(), // slot offset\n+ msf_hashFunction_getSlotoffset(256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+idmanager_getMyID(ADDR_64B)->addr_64b[7]), // slot offset\nCELLTYPE_RX, // type of slot\nFALSE, // shared?\n- msf_hashFunction_getChanneloffset(), // channel offset\n+ msf_hashFunction_getChanneloffset(256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+idmanager_getMyID(ADDR_64B)->addr_64b[7]), // channel offset\nidmanager_getMyID(ADDR_64B) // neighbor\n);\n@@ -401,23 +401,13 @@ void msf_housekeeping(void){\n}\n}\n-uint16_t msf_hashFunction_getSlotoffset(void){\n-\n- uint16_t moteId;\n-\n- moteId = 256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+\\\n- idmanager_getMyID(ADDR_64B)->addr_64b[7];\n+uint16_t msf_hashFunction_getSlotoffset(uint16_t moteId){\nreturn SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS + \\\n(moteId%(SLOTFRAME_LENGTH-SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS));\n}\n-uint8_t msf_hashFunction_getChanneloffset(void){\n-\n- uint16_t moteId;\n-\n- moteId = 256*idmanager_getMyID(ADDR_64B)->addr_64b[6]+\\\n- idmanager_getMyID(ADDR_64B)->addr_64b[7];\n+uint8_t msf_hashFunction_getChanneloffset(uint16_t moteId){\nreturn moteId%NUM_CHANNELS;\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "@@ -61,8 +61,8 @@ void msf_updateCellsUsed(open_addr_t* neighbor);\n// called by icmpv6rpl, where parent changed\nvoid msf_trigger6pClear(open_addr_t* neighbor);\n-uint16_t msf_hashFunction_getSlotoffset(void);\n-uint8_t msf_hashFunction_getChanneloffset(void);\n+uint16_t msf_hashFunction_getSlotoffset(uint16_t moteId);\n+uint8_t msf_hashFunction_getChanneloffset(uint16_t moteId);\n/**\n\\}\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -653,6 +653,9 @@ void registerNewNeighbor(open_addr_t* address,\nuint8_t joinPrio,\nbool insecure) {\nuint8_t i;\n+ uint16_t slotoffset;\n+ uint8_t channeloffset;\n+\n// filter errors\nif (address->type!=ADDR_64B) {\nopenserial_printCritical(COMPONENT_NEIGHBORS,ERR_WRONG_ADDR_TYPE,\n@@ -689,7 +692,15 @@ void registerNewNeighbor(open_addr_t* address,\nif (joinPrioPresent==TRUE){\nneighbors_vars.neighbors[i].joinPrio=joinPrio;\n}\n-\n+ slotoffset = msf_hashFunction_getSlotoffset(256*address->addr_64b[6]+address->addr_64b[7]);\n+ channeloffset = msf_hashFunction_getChanneloffset(256*address->addr_64b[6]+address->addr_64b[7]);\n+ schedule_addActiveSlot(\n+ slotoffset, // slot offset\n+ CELLTYPE_TX, // type of slot\n+ TRUE, // shared?\n+ channeloffset, // channel offset\n+ address // neighbor\n+ );\nbreak;\n}\ni++;\n@@ -714,13 +725,12 @@ bool isNeighbor(open_addr_t* neighbor) {\n}\nvoid removeNeighbor(uint8_t neighborIndex) {\n+ uint16_t slotoffset;\n+\nneighbors_vars.neighbors[neighborIndex].used = FALSE;\nneighbors_vars.neighbors[neighborIndex].parentPreference = 0;\nneighbors_vars.neighbors[neighborIndex].stableNeighbor = FALSE;\nneighbors_vars.neighbors[neighborIndex].switchStabilityCounter = 0;\n- //neighbors_vars.neighbors[neighborIndex].addr_16b.type = ADDR_NONE; // to save RAM\n- neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n- //neighbors_vars.neighbors[neighborIndex].addr_128b.type = ADDR_NONE; // to save RAM\nneighbors_vars.neighbors[neighborIndex].DAGrank = DEFAULTDAGRANK;\nneighbors_vars.neighbors[neighborIndex].rssi = 0;\nneighbors_vars.neighbors[neighborIndex].numRx = 0;\n@@ -733,6 +743,13 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].sequenceNumber = 0;\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n+\n+ slotoffset = msf_hashFunction_getSlotoffset(256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7]);\n+ schedule_removeActiveSlot(\n+ slotoffset, // slot offset\n+ &(neighbors_vars.neighbors[neighborIndex].addr_64b) // neighbor\n+ );\n+ neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n//=========================== helpers =========================================\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. add autonomous tx cell when new neighbor is found and remove the cell when neighbor is removed.
|
491,595 |
05.11.2018 16:19:18
| -3,600 |
05288ad46eab6dd7dbf523461b9083c443098bff
|
increase the number of timers supported.
|
[
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.c",
"new_path": "drivers/common/openserial.c",
"diff": "@@ -99,6 +99,7 @@ void openserial_init(void) {\nopenserial_vars.outputBufIdxW = 0;\nopenserial_vars.fBusyFlushing = FALSE;\n+ openserial_vars.reset_timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopenserial_vars.debugPrint_timerId = opentimers_create(TIMER_GENERAL_PURPOSE);\nopentimers_scheduleIn(\nopenserial_vars.debugPrint_timerId,\n@@ -189,17 +190,15 @@ owerror_t openserial_printCritical(\nerrorparameter_t arg1,\nerrorparameter_t arg2\n) {\n- opentimers_id_t id;\nuint32_t reference;\n// blink error LED, this is serious\nleds_error_blink();\n// schedule for the mote to reboot in 10s\n- id = opentimers_create(TIMER_GENERAL_PURPOSE);\nreference = opentimers_getValue();\nopentimers_scheduleAbsolute(\n- id, // timerId\n+ openserial_vars.reset_timerId, // timerId\n10000, // duration\nreference, // reference\nTIME_MS, // timetype\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/openserial.h",
"new_path": "drivers/common/openserial.h",
"diff": "@@ -101,6 +101,7 @@ typedef struct {\nuint8_t ctsStateChanged;\nuint8_t debugPrintCounter;\nopenserial_rsvpt* registeredCmd;\n+ uint8_t reset_timerId;\nuint8_t debugPrint_timerId;\n// input\nuint8_t inputBuf[SERIAL_INPUT_BUFFER_SIZE];\n"
},
{
"change_type": "MODIFY",
"old_path": "drivers/common/opentimers.h",
"new_path": "drivers/common/opentimers.h",
"diff": "//=========================== define ==========================================\n/// Maximum number of timers that can run concurrently\n-#define MAX_NUM_TIMERS 10\n+#define MAX_NUM_TIMERS 15\n#define MAX_TICKS_IN_SINGLE_CLOCK (uint32_t)(((PORT_TIMER_WIDTH)0xFFFFFFFF)>>1)\n#define ERROR_NO_AVAILABLE_ENTRIES 255\n#define MAX_DURATION_ISR 33 // 33@32768Hz = 1ms\n"
},
{
"change_type": "MODIFY",
"old_path": "openapps/cjoin/cjoin.c",
"new_path": "openapps/cjoin/cjoin.c",
"diff": "@@ -210,7 +210,6 @@ void cjoin_task_cb(void) {\n// init the security context only here in order to use the latest joinKey\n// that may be set over the serial\n// cjoin_init_security_context();\n-\ncjoin_sendJoinRequest(joinProxy);\nreturn;\n@@ -249,6 +248,7 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\n);\nreturn E_FAIL;\n}\n+\n// take ownership over that packet\npkt->creator = COMPONENT_CJOIN;\npkt->owner = COMPONENT_CJOIN;\n@@ -292,7 +292,6 @@ owerror_t cjoin_sendJoinRequest(open_addr_t* joinProxy) {\npayload_len = cojp_cbor_encode_join_request_object(tmp, &join_request);\npacketfunctions_reserveHeaderSize(pkt, payload_len);\nmemcpy(pkt->payload, tmp, payload_len);\n-\n// send\noutcome = opencoap_send(\npkt,\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. increase the number of timers supported.
|
491,595 |
05.11.2018 22:46:53
| -3,600 |
64c2fdc109d76d724400c860280b9d6bac2a7b17
|
don't remove the autonomous cell.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -99,7 +99,7 @@ void msf_updateCellsUsed(open_addr_t* neighbor){\nvoid msf_trigger6pClear(open_addr_t* neighbor){\n- if (schedule_hasDedicatedCellToNeighbor(neighbor)>0){\n+ if (schedule_hasNonSharedDedicatedCellToNeighbor(neighbor)>0){\nsixtop_request(\nIANA_6TOP_CMD_CLEAR, // code\nneighbor, // neighbor\n@@ -368,10 +368,6 @@ void msf_housekeeping(void){\nif (foundNeighbor==FALSE) {\nreturn;\n}\n- if (schedule_getNumberOfDedicatedCells(&parentNeighbor)==0){\n- msf_trigger6pAdd();\n- return;\n- }\nif (msf_vars.waitretry){\nreturn;\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.h",
"new_path": "openstack/02b-MAChigh/msf.h",
"diff": "//=========================== define ==========================================\n#define IANA_6TISCH_SFID_MSF 0\n-#define CELLOPTIONS_MSF CELLOPTIONS_TX | CELLOPTIONS_RX | CELLOPTIONS_SHARED\n+#define CELLOPTIONS_MSF CELLOPTIONS_TX\n#define NUMCELLS_MSF 1\n#define MAX_NUMCELLS 16\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -634,6 +634,27 @@ bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor){\nreturn FALSE;\n}\n+bool schedule_hasNonSharedDedicatedCellToNeighbor(open_addr_t* neighbor){\n+ uint8_t i;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ for(i=0;i<MAXACTIVESLOTS;i++) {\n+ if(\n+ schedule_vars.scheduleBuf[i].shared == FALSE &&\n+ schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\n+ packetfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n+ ){\n+ ENABLE_INTERRUPTS();\n+ return TRUE;\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+ return FALSE;\n+}\n+\n//=== from IEEE802154E: reading the schedule and updating statistics\nvoid schedule_syncSlotOffset(slotOffset_t targetSlotOffset) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -184,6 +184,7 @@ uint8_t schedule_getNumberOfDedicatedCells(open_addr_t* neighbor);\nbool schedule_isNumTxWrapped(open_addr_t* neighbor);\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist);\nbool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor);\n+bool schedule_hasNonSharedDedicatedCellToNeighbor(open_addr_t* neighbor);\nopen_addr_t* schedule_getNonParentNeighborWithDedicatedCells(open_addr_t* neighbor);\n// from IEEE802154E\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -628,6 +628,7 @@ functionsToChange = [\n'schedule_getNumberOfDedicatedCells',\n'schedule_getNonParentNeighborWithDedicatedCells',\n'schedule_hasDedicatedCellToNeighbor',\n+ 'schedule_hasNonSharedDedicatedCellToNeighbor',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. don't remove the autonomous cell.
|
491,595 |
06.11.2018 16:15:35
| -3,600 |
c701c65e03149825f897cb8c62b1d72f83175261
|
increase the backoff exponent and maxmium number of tries.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -38,7 +38,7 @@ static const uint8_t ebIEsBytestream[] = {\n#define EB_IE_LEN 28\n#define NUM_CHANNELS 16 // number of channels to channel hop on\n-#define TXRETRIES 3 // number of MAC retries before declaring failed\n+#define TXRETRIES 7 // number of MAC retries before declaring failed\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -60,14 +60,14 @@ Backoff is used only in slots that are marked as shared in the schedule. When\nnot shared, the mote assumes that schedule is collision-free, and therefore\ndoes not use any backoff mechanism when a transmission fails.\n*/\n-#define MINBE 2\n+#define MINBE 2 // the standard compliant range of MAXBE is 0-MAXBE\n/**\n\\brief Maximum backoff exponent.\nSee MINBE for an explanation of backoff.\n*/\n-#define MAXBE 4\n+#define MAXBE 8 // the standard compliant range of MAXBE is 3-8\n/**\n\\brief a threshold used for triggering the maintaining process.uint: percent\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. increase the backoff exponent and maxmium number of tries.
|
491,595 |
06.11.2018 18:03:31
| -3,600 |
6ece5f32efd08c276e6ee82f9c226aa14e0624db
|
just reserve autonomous cell to parent.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -532,7 +532,34 @@ void neighbors_setNeighborNoResource(open_addr_t* address){\n}\nvoid neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n+\n+ uint16_t moteId;\n+\nneighbors_vars.neighbors[index].parentPreference = isPreferred;\n+\n+ moteId = 256*neighbors_vars.neighbors[index].addr_64b.addr_64b[6]+\\\n+ neighbors_vars.neighbors[index].addr_64b.addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ channeloffset = msf_hashFunction_getChanneloffset(moteId);\n+\n+ if (isPreferred){\n+ // the neighbor is selected as parent\n+ // reserve the autonomous cell to this neighbor\n+ schedule_addActiveSlot(\n+ slotoffset, // slot offset\n+ CELLTYPE_TX, // type of slot\n+ TRUE, // shared?\n+ channeloffset, // channel offset\n+ &(neighbors_vars.neighbors[index].addr_64b) // neighbor\n+ );\n+ } else {\n+ // the neighbor is de-selected as parent\n+ // remove the autonomous cell to this neighbor\n+ schedule_removeActiveSlot(\n+ slotoffset, // slot offset\n+ &(neighbors_vars.neighbors[index].addr_64b) // neighbor\n+ );\n+ }\n}\n//===== managing routing info\n@@ -692,15 +719,6 @@ void registerNewNeighbor(open_addr_t* address,\nif (joinPrioPresent==TRUE){\nneighbors_vars.neighbors[i].joinPrio=joinPrio;\n}\n- slotoffset = msf_hashFunction_getSlotoffset(256*address->addr_64b[6]+address->addr_64b[7]);\n- channeloffset = msf_hashFunction_getChanneloffset(256*address->addr_64b[6]+address->addr_64b[7]);\n- schedule_addActiveSlot(\n- slotoffset, // slot offset\n- CELLTYPE_TX, // type of slot\n- TRUE, // shared?\n- channeloffset, // channel offset\n- address // neighbor\n- );\nbreak;\n}\ni++;\n@@ -743,12 +761,6 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].sequenceNumber = 0;\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n-\n- slotoffset = msf_hashFunction_getSlotoffset(256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7]);\n- schedule_removeActiveSlot(\n- slotoffset, // slot offset\n- &(neighbors_vars.neighbors[neighborIndex].addr_64b) // neighbor\n- );\nneighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. just reserve autonomous cell to parent.
|
491,595 |
06.11.2018 18:47:25
| -3,600 |
27504b4993d5852068168ea97849663a8d3cd36f
|
remove cell only when it exist.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -557,12 +557,14 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n} else {\n// the neighbor is de-selected as parent\n// remove the autonomous cell to this neighbor\n+ if (schedule_hasDedicatedCellToNeighbor(&(neighbors_vars.neighbors[index].addr_64b))){\nschedule_removeActiveSlot(\nslotoffset, // slot offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n);\n}\n}\n+}\n//===== managing routing info\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. remove cell only when it exist.
|
491,595 |
06.11.2018 21:29:16
| -3,600 |
d56a6d9de5f04fb93a74a6fe1a1c0d962d798bd2
|
regulate the traffic on different cells and update functions names.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -952,13 +952,20 @@ port_INLINE void activity_ti1ORri1(void) {\n// check whether we can send\nif (schedule_getOkToSend()) {\nif (packetfunctions_isBroadcastMulticast(&neighbor)==FALSE){\n- // this is a dedicated cell\n- ieee154e_vars.dataToSend = openqueue_macGetDedicatedPacket(&neighbor);\n- // update numcellpassed and numcellused on dedicated cell\n+\n+ if (schedule_getShared()){\n+ // this is an autonomous Tx cell\n+ ieee154e_vars.dataToSend = openqueue_macGet6PandJoinPacket(&neighbor);\n+ } else {\n+ // this is a managed Tx cell\n+ ieee154e_vars.dataToSend = openqueue_macGetNonJoinIPv6Packet(&neighbor);\n+\n+ // update numcellpassed and numcellused on managed Tx cell\nif (ieee154e_vars.dataToSend!=NULL) {\nmsf_updateCellsUsed(&neighbor);\n}\nmsf_updateCellsPassed(&neighbor);\n+ }\n} else {\n// this is minimal cell\nieee154e_vars.dataToSend = openqueue_macGetDataPacket(&neighbor);\n@@ -969,14 +976,9 @@ port_INLINE void activity_ti1ORri1(void) {\n} else {\n// there is a packet to send\nif (\n- schedule_hasDedicatedCellToNeighbor(&ieee154e_vars.dataToSend->l2_nextORpreviousHop)\n+ schedule_hasAutonomousTxCellToNeighbor(&ieee154e_vars.dataToSend->l2_nextORpreviousHop)\n) {\n- // allow sixtop response with SEQNUM_ERR return code send on minimal cell\n- if (\n- ieee154e_vars.dataToSend->creator!=COMPONENT_SIXTOP_RES ||\n- ieee154e_vars.dataToSend->l2_sixtop_returnCode != IANA_6TOP_RC_SEQNUM_ERR\n- ) {\n- // leave the packet to be sent on dedicated cell and pick up a broadcast packet.\n+ // leave the packet to be sent on autonomous Tx Cell cell and pick up a broadcast packet.\nieee154e_vars.dataToSend = openqueue_macGetDIOPacket();\nif (ieee154e_vars.dataToSend==NULL){\ncouldSendEB=TRUE;\n@@ -987,7 +989,6 @@ port_INLINE void activity_ti1ORri1(void) {\n}\n}\n}\n- }\nif (ieee154e_vars.dataToSend==NULL) {\nif (cellType==CELLTYPE_TX) {\n@@ -1920,7 +1921,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\n} else {\n// synchronize to the received packet if I'm not a DAGroot and this is my preferred parent\n// or in case I'm in the middle of the join process when parent is not yet selected\n- // or in case I don't have a dedicated cell to my parent yet\n+ // or in case I don't have an autonomous Tx cell cell to my parent yet\nif (\nidmanager_getIsDAGroot() == FALSE &&\n(\n@@ -1929,7 +1930,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasDedicatedCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n)\n)\n) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/msf.c",
"new_path": "openstack/02b-MAChigh/msf.c",
"diff": "@@ -99,7 +99,7 @@ void msf_updateCellsUsed(open_addr_t* neighbor){\nvoid msf_trigger6pClear(open_addr_t* neighbor){\n- if (schedule_hasNonSharedDedicatedCellToNeighbor(neighbor)>0){\n+ if (schedule_hasManagedTxCellToNeighbor(neighbor)){\nsixtop_request(\nIANA_6TOP_CMD_CLEAR, // code\nneighbor, // neighbor\n@@ -269,8 +269,8 @@ void msf_trigger6pDelete(void){\nreturn;\n}\n- if (schedule_getNumberOfDedicatedCells(&neighbor)<=1){\n- // at least one dedicated cell presents\n+ if (schedule_getNumberOfManagedTxCells(&neighbor)<=1){\n+ // at least one managed Tx cell presents\nreturn;\n}\n@@ -369,6 +369,11 @@ void msf_housekeeping(void){\nreturn;\n}\n+ if (schedule_getNumberOfManagedTxCells(&parentNeighbor)==0){\n+ msf_trigger6pAdd();\n+ return;\n+ }\n+\nif (msf_vars.waitretry){\nreturn;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -557,7 +557,7 @@ void neighbors_setPreferredParent(uint8_t index, bool isPreferred){\n} else {\n// the neighbor is de-selected as parent\n// remove the autonomous cell to this neighbor\n- if (schedule_hasDedicatedCellToNeighbor(&(neighbors_vars.neighbors[index].addr_64b))){\n+ if (schedule_hasAutonomousTxCellToNeighbor(&(neighbors_vars.neighbors[index].addr_64b))){\nschedule_removeActiveSlot(\nslotoffset, // slot offset\n&(neighbors_vars.neighbors[index].addr_64b) // neighbor\n@@ -627,7 +627,7 @@ void neighbors_removeOld(void) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasDedicatedCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n)\n) {\nreturn;\n@@ -749,6 +749,7 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].parentPreference = 0;\nneighbors_vars.neighbors[neighborIndex].stableNeighbor = FALSE;\nneighbors_vars.neighbors[neighborIndex].switchStabilityCounter = 0;\n+ neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\nneighbors_vars.neighbors[neighborIndex].DAGrank = DEFAULTDAGRANK;\nneighbors_vars.neighbors[neighborIndex].rssi = 0;\nneighbors_vars.neighbors[neighborIndex].numRx = 0;\n@@ -761,7 +762,6 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].sequenceNumber = 0;\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n- neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n//=========================== helpers =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -497,7 +497,7 @@ uint8_t schedule_getNumberOfFreeEntries(){\nreturn counter;\n}\n-uint8_t schedule_getNumberOfDedicatedCells(open_addr_t* neighbor){\n+uint8_t schedule_getNumberOfManagedTxCells(open_addr_t* neighbor){\nuint8_t i;\nuint8_t counter;\n@@ -507,6 +507,8 @@ uint8_t schedule_getNumberOfDedicatedCells(open_addr_t* neighbor){\ncounter = 0;\nfor(i=0;i<MAXACTIVESLOTS;i++) {\nif(\n+ schedule_vars.scheduleBuf[i].shared == FALSE &&\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TX &&\npacketfunctions_sameAddress(&schedule_vars.scheduleBuf[i].neighbor, neighbor) == TRUE\n){\ncounter++;\n@@ -518,26 +520,6 @@ uint8_t schedule_getNumberOfDedicatedCells(open_addr_t* neighbor){\nreturn counter;\n}\n-open_addr_t* schedule_getNonParentNeighborWithDedicatedCells(open_addr_t* neighbor){\n- uint8_t i;\n- INTERRUPT_DECLARATION();\n- DISABLE_INTERRUPTS();\n-\n- for(i=0;i<MAXACTIVESLOTS;i++) {\n- if(\n- schedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\n- packetfunctions_sameAddress(&schedule_vars.scheduleBuf[i].neighbor, neighbor) == FALSE\n- ){\n- ENABLE_INTERRUPTS();\n- return &schedule_vars.scheduleBuf[i].neighbor;\n- }\n- }\n-\n- ENABLE_INTERRUPTS();\n-\n- return NULL;\n-}\n-\nbool schedule_isNumTxWrapped(open_addr_t* neighbor){\nuint8_t i;\nbool returnVal;\n@@ -614,7 +596,7 @@ bool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist\nreturn FALSE;\n}\n-bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor){\n+bool schedule_hasAutonomousTxCellToNeighbor(open_addr_t* neighbor){\nuint8_t i;\nINTERRUPT_DECLARATION();\n@@ -622,6 +604,8 @@ bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor){\nfor(i=0;i<MAXACTIVESLOTS;i++) {\nif(\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TX &&\n+ schedule_vars.scheduleBuf[i].shared &&\nschedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\npacketfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n){\n@@ -634,7 +618,7 @@ bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor){\nreturn FALSE;\n}\n-bool schedule_hasNonSharedDedicatedCellToNeighbor(open_addr_t* neighbor){\n+bool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor){\nuint8_t i;\nINTERRUPT_DECLARATION();\n@@ -734,6 +718,25 @@ cellType_t schedule_getType(void) {\nreturn returnVal;\n}\n+/**\n+\n+\\brief Get the isShared of the current schedule entry.\n+\n+\\returns The isShared of the current schedule entry.\n+*/\n+bool schedule_getShared(void) {\n+ cellType_t returnVal;\n+\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ returnVal = schedule_vars.currentScheduleEntry->shared;\n+\n+ ENABLE_INTERRUPTS();\n+\n+ return returnVal;\n+}\n+\n/**\n\\brief Get the neighbor associated wit the current schedule entry.\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -180,12 +180,11 @@ void schedule_removeAllCells(\nopen_addr_t* previousHop\n);\nuint8_t schedule_getNumberOfFreeEntries(void);\n-uint8_t schedule_getNumberOfDedicatedCells(open_addr_t* neighbor);\n+uint8_t schedule_getNumberOfManagedTxCells(open_addr_t* neighbor);\nbool schedule_isNumTxWrapped(open_addr_t* neighbor);\nbool schedule_getCellsToBeRelocated(open_addr_t* neighbor, cellInfo_ht* celllist);\n-bool schedule_hasDedicatedCellToNeighbor(open_addr_t* neighbor);\n-bool schedule_hasNonSharedDedicatedCellToNeighbor(open_addr_t* neighbor);\n-open_addr_t* schedule_getNonParentNeighborWithDedicatedCells(open_addr_t* neighbor);\n+bool schedule_hasAutonomousTxCellToNeighbor(open_addr_t* neighbor);\n+bool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor);\n// from IEEE802154E\nvoid schedule_syncSlotOffset(slotOffset_t targetSlotOffset);\n@@ -193,6 +192,7 @@ void schedule_advanceSlot(void);\nslotOffset_t schedule_getNextActiveSlotOffset(void);\nframeLength_t schedule_getFrameLength(void);\ncellType_t schedule_getType(void);\n+bool schedule_getShared(void);\nvoid schedule_getNeighbor(open_addr_t* addrToWrite);\nchannelOffset_t schedule_getChannelOffset(void);\nbool schedule_getOkToSend(void);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "@@ -362,7 +362,7 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasDedicatedCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n)\n)\n)\n@@ -716,7 +716,7 @@ port_INLINE void sixtop_sendEB(void) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasDedicatedCellToNeighbor(&addressToWrite) == FALSE\n+ schedule_hasAutonomousTxCellToNeighbor(&addressToWrite) == FALSE\n)\n)\n){\n@@ -844,7 +844,7 @@ port_INLINE void sixtop_sendKA(void) {\nreturn;\n}\n- if (schedule_hasDedicatedCellToNeighbor(kaNeighAddr) == FALSE){\n+ if (schedule_hasAutonomousTxCellToNeighbor(kaNeighAddr) == FALSE){\n// delete packets genereted by this module (EB and KA) from openqueue\nopenqueue_removeAllCreatedBy(COMPONENT_SIXTOP);\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -290,7 +290,7 @@ OpenQueueEntry_t* openqueue_macGetDIOPacket(){\nreturn NULL;\n}\n-OpenQueueEntry_t* openqueue_macGetDedicatedPacket(open_addr_t* toNeighbor){\n+OpenQueueEntry_t* openqueue_macGetNonJoinIPv6Packet(open_addr_t* toNeighbor){\nuint8_t i;\nuint8_t packet_index;\nINTERRUPT_DECLARATION();\n@@ -304,11 +304,9 @@ OpenQueueEntry_t* openqueue_macGetDedicatedPacket(open_addr_t* toNeighbor){\n(\ntoNeighbor->type==ADDR_64B &&\npacketfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n- ) && // sixtop response with SEQNUM_ERR will fail on dedicated cell since schedule inconsistency.\n- (\n- openqueue_vars.queue[i].creator != COMPONENT_SIXTOP_RES ||\n- openqueue_vars.queue[i].l2_sixtop_returnCode != IANA_6TOP_RC_SEQNUM_ERR\n- )\n+ ) &&\n+ openqueue_vars.queue[i].creator >= COMPONENT_OPENBRIDGE &&\n+ openqueue_vars.queue[i].creator != COMPONENT_CJOIN\n){\nif (packet_index==QUEUELENGTH){\npacket_index = i;\n@@ -329,6 +327,33 @@ OpenQueueEntry_t* openqueue_macGetDedicatedPacket(open_addr_t* toNeighbor){\n}\n}\n+OpenQueueEntry_t* openqueue_macGet6PandJoinPacket(open_addr_t* toNeighbor){\n+ uint8_t i;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+\n+ // first to look the sixtop RES packet\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (\n+ openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ (\n+ toNeighbor->type==ADDR_64B &&\n+ packetfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ ) &&\n+ (\n+ openqueue_vars.queue[i].creator == COMPONENT_SIXTOP_RES ||\n+ openqueue_vars.queue[i].creator == COMPONENT_CJOIN\n+ )\n+ ){\n+ ENABLE_INTERRUPTS();\n+ return &openqueue_vars.queue[i];\n+ }\n+ }\n+\n+ ENABLE_INTERRUPTS();\n+ return NULL;\n+}\n+\n//=========================== private =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -45,7 +45,8 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\nOpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetEBPacket(void);\nOpenQueueEntry_t* openqueue_macGetDIOPacket(void);\n-OpenQueueEntry_t* openqueue_macGetDedicatedPacket(open_addr_t* toNeighbor);\n+OpenQueueEntry_t* openqueue_macGetNonJoinIPv6Packet(open_addr_t* toNeighbor);\n+OpenQueueEntry_t* openqueue_macGet6PandJoinPacket(open_addr_t* toNeighbor);\n/**\n\\}\n\\}\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -617,6 +617,7 @@ functionsToChange = [\n'schedule_getNextActiveSlotOffset',\n'schedule_getFrameLength',\n'schedule_getType',\n+ 'schedule_getShared',\n'schedule_getNeighbor',\n'schedule_getChannelOffset',\n'schedule_getOkToSend',\n@@ -625,10 +626,9 @@ functionsToChange = [\n'schedule_indicateTx',\n'schedule_resetEntry',\n'schedule_getNumberOfFreeEntries',\n- 'schedule_getNumberOfDedicatedCells',\n- 'schedule_getNonParentNeighborWithDedicatedCells',\n- 'schedule_hasDedicatedCellToNeighbor',\n- 'schedule_hasNonSharedDedicatedCellToNeighbor',\n+ 'schedule_getNumberOfManagedTxCells',\n+ 'schedule_hasAutonomousTxCellToNeighbor',\n+ 'schedule_hasManagedTxCellToNeighbor',\n'schedule_isNumTxWrapped',\n'schedule_getCellsToBeRelocated',\n'schedule_getOneCellAfterOffset',\n@@ -817,7 +817,8 @@ functionsToChange = [\n'openqueue_macGetEBPacket',\n'openqueue_reset_entry',\n'openqueue_macGetDIOPacket',\n- 'openqueue_macGetDedicatedPacket',\n+ 'openqueue_macGetNonJoinIPv6Packet',\n+ 'openqueue_macGet6PandJoinPacket',\n# openrandom\n'openrandom_init',\n'openrandom_get16b',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. regulate the traffic on different cells and update functions names.
|
491,595 |
06.11.2018 21:54:25
| -3,600 |
c08238b1f0988da77ae3fa6ecd8da78a1614629c
|
reserve downstream autonomous cell.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/neighbors.c",
"new_path": "openstack/02b-MAChigh/neighbors.c",
"diff": "@@ -745,11 +745,13 @@ bool isNeighbor(open_addr_t* neighbor) {\n}\nvoid removeNeighbor(uint8_t neighborIndex) {\n+\n+ uint16_t moteId, slotoffset;\n+\nneighbors_vars.neighbors[neighborIndex].used = FALSE;\nneighbors_vars.neighbors[neighborIndex].parentPreference = 0;\nneighbors_vars.neighbors[neighborIndex].stableNeighbor = FALSE;\nneighbors_vars.neighbors[neighborIndex].switchStabilityCounter = 0;\n- neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\nneighbors_vars.neighbors[neighborIndex].DAGrank = DEFAULTDAGRANK;\nneighbors_vars.neighbors[neighborIndex].rssi = 0;\nneighbors_vars.neighbors[neighborIndex].numRx = 0;\n@@ -762,6 +764,18 @@ void removeNeighbor(uint8_t neighborIndex) {\nneighbors_vars.neighbors[neighborIndex].sequenceNumber = 0;\nneighbors_vars.neighbors[neighborIndex].backoffExponenton = MINBE-1;;\nneighbors_vars.neighbors[neighborIndex].backoff = 0;\n+\n+ if (schedule_hasAutonomousTxCellToNeighbor(&(neighbors_vars.neighbors[neighborIndex].addr_64b))){\n+ moteId = 256*neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[6]+\\\n+ neighbors_vars.neighbors[neighborIndex].addr_64b.addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ schedule_removeActiveSlot(\n+ slotoffset, // slot offset\n+ &(neighbors_vars.neighbors[neighborIndex].addr_64b) // neighbor\n+ );\n+ }\n+\n+ neighbors_vars.neighbors[neighborIndex].addr_64b.type = ADDR_NONE;\n}\n//=========================== helpers =========================================\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/sixtop.c",
"new_path": "openstack/02b-MAChigh/sixtop.c",
"diff": "#include \"IEEE802154_security.h\"\n#include \"idmanager.h\"\n#include \"schedule.h\"\n+#include \"msf.h\"\n//=========================== define ==========================================\n@@ -351,6 +352,8 @@ owerror_t sixtop_request(\nowerror_t sixtop_send(OpenQueueEntry_t *msg) {\n+ uint16_t slotoffset, moteId;\n+ uint8_t channeloffset;\nopen_addr_t addressToWrite;\nif (\n@@ -370,6 +373,30 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) {\nreturn E_FAIL;\n}\n+ if (\n+ idmanager_getIsDAGroot() == TRUE ||\n+ (\n+ idmanager_getIsDAGroot() == FALSE &&\n+ icmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n+ packetfunctions_sameAddress(&addressToWrite, &msg->l2_nextORpreviousHop)== FALSE\n+ )\n+ ) {\n+ if (schedule_hasAutonomousTxCellToNeighbor(&msg->l2_nextORpreviousHop)==FALSE){\n+ moteId = 256*msg->l2_nextORpreviousHop.addr_64b[6]+\\\n+ msg->l2_nextORpreviousHop.addr_64b[7];\n+ slotoffset = msf_hashFunction_getSlotoffset(moteId);\n+ channeloffset = msf_hashFunction_getChanneloffset(moteId);\n+ schedule_addActiveSlot(\n+ slotoffset, // slot offset\n+ CELLTYPE_TX, // type of slot\n+ TRUE, // shared?\n+ channeloffset, // channel offset\n+ &(msg->l2_nextORpreviousHop) // neighbor\n+ );\n+ }\n+ }\n+\n+\n// set metadata\nmsg->owner = COMPONENT_SIXTOP;\nmsg->l2_frameType = IEEE154_TYPE_DATA;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. reserve downstream autonomous cell.
|
491,595 |
07.11.2018 01:46:43
| -3,600 |
9e637776d37b130aabdfa540aa9d64464457967d
|
update ka period and DESYNCTIMEOUT.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.c",
"new_path": "openstack/02a-MAClow/IEEE802154E.c",
"diff": "@@ -960,6 +960,10 @@ port_INLINE void activity_ti1ORri1(void) {\n// this is a managed Tx cell\nieee154e_vars.dataToSend = openqueue_macGetNonJoinIPv6Packet(&neighbor);\n+ if (ieee154e_vars.dataToSend == NULL){\n+ ieee154e_vars.dataToSend = openqueue_macGetKaPacket(&neighbor);\n+ }\n+\n// update numcellpassed and numcellused on managed Tx cell\nif (ieee154e_vars.dataToSend!=NULL) {\nmsf_updateCellsUsed(&neighbor);\n@@ -1930,7 +1934,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) {\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n(\nicmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n- schedule_hasAutonomousTxCellToNeighbor(&addressToWrite)== FALSE\n+ schedule_hasManagedTxCellToNeighbor(&addressToWrite)== FALSE\n)\n)\n) {\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -42,8 +42,8 @@ static const uint8_t ebIEsBytestream[] = {\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n-#define MAXKAPERIOD 1000 // in slots: 2000@15ms per slot -> ~30 seconds. Max value used by adaptive synchronization.\n-#define DESYNCTIMEOUT 2333 // in slots: 2333@15ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.\n+#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization.\n+#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT.\n#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection \"large\"\n#define LENGTH_IEEE154_MAX 128 // max length of a valid radio packet\n#define DUTY_CYCLE_WINDOW_LIMIT (0xFFFFFFFF>>1) // limit of the dutycycle window\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -627,6 +627,7 @@ bool schedule_hasManagedTxCellToNeighbor(open_addr_t* neighbor){\nfor(i=0;i<MAXACTIVESLOTS;i++) {\nif(\nschedule_vars.scheduleBuf[i].shared == FALSE &&\n+ schedule_vars.scheduleBuf[i].type == CELLTYPE_TX &&\nschedule_vars.scheduleBuf[i].neighbor.type == ADDR_64B &&\npacketfunctions_sameAddress(neighbor,&schedule_vars.scheduleBuf[i].neighbor)\n){\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.c",
"new_path": "openstack/cross-layers/openqueue.c",
"diff": "@@ -274,6 +274,24 @@ OpenQueueEntry_t* openqueue_macGetEBPacket(void) {\nreturn NULL;\n}\n+OpenQueueEntry_t* openqueue_macGetKaPacket(open_addr_t* toNeighbor) {\n+ uint8_t i;\n+ INTERRUPT_DECLARATION();\n+ DISABLE_INTERRUPTS();\n+ for (i=0;i<QUEUELENGTH;i++) {\n+ if (openqueue_vars.queue[i].owner==COMPONENT_SIXTOP_TO_IEEE802154E &&\n+ openqueue_vars.queue[i].creator==COMPONENT_SIXTOP &&\n+ toNeighbor->type==ADDR_64B &&\n+ packetfunctions_sameAddress(toNeighbor,&openqueue_vars.queue[i].l2_nextORpreviousHop)\n+ ) {\n+ ENABLE_INTERRUPTS();\n+ return &openqueue_vars.queue[i];\n+ }\n+ }\n+ ENABLE_INTERRUPTS();\n+ return NULL;\n+}\n+\nOpenQueueEntry_t* openqueue_macGetDIOPacket(){\nuint8_t i;\nINTERRUPT_DECLARATION();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/cross-layers/openqueue.h",
"new_path": "openstack/cross-layers/openqueue.h",
"diff": "@@ -44,6 +44,7 @@ OpenQueueEntry_t* openqueue_sixtopGetReceivedPacket(void);\n// called by IEEE80215E\nOpenQueueEntry_t* openqueue_macGetDataPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetEBPacket(void);\n+OpenQueueEntry_t* openqueue_macGetKaPacket(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGetDIOPacket(void);\nOpenQueueEntry_t* openqueue_macGetNonJoinIPv6Packet(open_addr_t* toNeighbor);\nOpenQueueEntry_t* openqueue_macGet6PandJoinPacket(open_addr_t* toNeighbor);\n"
},
{
"change_type": "MODIFY",
"old_path": "projects/python/SConscript.env",
"new_path": "projects/python/SConscript.env",
"diff": "@@ -815,6 +815,7 @@ functionsToChange = [\n'openqueue_sixtopGetReceivedPacket',\n'openqueue_macGetDataPacket',\n'openqueue_macGetEBPacket',\n+ 'openqueue_macGetKaPacket',\n'openqueue_reset_entry',\n'openqueue_macGetDIOPacket',\n'openqueue_macGetNonJoinIPv6Packet',\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. update ka period and DESYNCTIMEOUT.
|
491,595 |
07.11.2018 13:18:33
| -3,600 |
d820701bdf5f6437709516dec7626b1a761fcf85
|
change retries to 3 and maxbe to 5.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02a-MAClow/IEEE802154E.h",
"new_path": "openstack/02a-MAClow/IEEE802154E.h",
"diff": "@@ -38,7 +38,7 @@ static const uint8_t ebIEsBytestream[] = {\n#define EB_IE_LEN 28\n#define NUM_CHANNELS 16 // number of channels to channel hop on\n-#define TXRETRIES 7 // number of MAC retries before declaring failed\n+#define TXRETRIES 3 // number of MAC retries before declaring failed\n#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value)\n#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize\n#define US_PER_TICK 30 // number of us per 32kHz clock tick\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.h",
"new_path": "openstack/02b-MAChigh/schedule.h",
"diff": "@@ -67,7 +67,7 @@ does not use any backoff mechanism when a transmission fails.\nSee MINBE for an explanation of backoff.\n*/\n-#define MAXBE 8 // the standard compliant range of MAXBE is 3-8\n+#define MAXBE 5 // the standard compliant range of MAXBE is 3-8\n/**\n\\brief a threshold used for triggering the maintaining process.uint: percent\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. change retries to 3 and maxbe to 5.
|
491,595 |
07.11.2018 15:02:35
| -3,600 |
17b07ef0bb461657950a73dba771c6e0f53fc9d0
|
don't send any packet before having a managed cell.
|
[
{
"change_type": "MODIFY",
"old_path": "openstack/02b-MAChigh/schedule.c",
"new_path": "openstack/02b-MAChigh/schedule.c",
"diff": "@@ -726,7 +726,7 @@ cellType_t schedule_getType(void) {\n\\returns The isShared of the current schedule entry.\n*/\nbool schedule_getShared(void) {\n- cellType_t returnVal;\n+ bool returnVal;\nINTERRUPT_DECLARATION();\nDISABLE_INTERRUPTS();\n"
},
{
"change_type": "MODIFY",
"old_path": "openstack/03b-IPv6/icmpv6rpl.c",
"new_path": "openstack/03b-IPv6/icmpv6rpl.c",
"diff": "@@ -639,7 +639,11 @@ void icmpv6rpl_timer_DIO_task(void) {\n\\brief Prepare and a send a RPL DIO.\n*/\nvoid sendDIO(void) {\n+\nOpenQueueEntry_t* msg;\n+ open_addr_t addressToWrite;\n+\n+ memset(&addressToWrite,0,sizeof(open_addr_t));\n// stop if I'm not sync'ed\nif (ieee154e_isSynch()==FALSE) {\n@@ -660,6 +664,26 @@ void sendDIO(void) {\nreturn;\n}\n+ if (\n+ idmanager_getIsDAGroot() == FALSE &&\n+ (\n+ icmpv6rpl_getPreferredParentEui64(&addressToWrite) == FALSE ||\n+ (\n+ icmpv6rpl_getPreferredParentEui64(&addressToWrite) &&\n+ schedule_hasManagedTxCellToNeighbor(&addressToWrite) == FALSE\n+ )\n+ )\n+ ){\n+ // delete packets genereted by this module (EB and KA) from openqueue\n+ openqueue_removeAllCreatedBy(COMPONENT_ICMPv6RPL);\n+\n+ // I'm not busy sending a DIO/DAO\n+ icmpv6rpl_vars.busySendingDIO = FALSE;\n+ icmpv6rpl_vars.busySendingDAO = FALSE;\n+\n+ return;\n+ }\n+\n// do not send DIO if I'm already busy sending\nif (icmpv6rpl_vars.busySendingDIO==TRUE) {\nreturn;\n@@ -790,6 +814,8 @@ void sendDAO(void) {\nopen_addr_t address;\nopen_addr_t* prefix;\n+ memset(&address,0,sizeof(open_addr_t));\n+\nif (ieee154e_isSynch()==FALSE) {\n// I'm not sync'ed\n@@ -814,6 +840,25 @@ void sendDAO(void) {\nreturn;\n}\n+ if (\n+ icmpv6rpl_getPreferredParentEui64(&address) == FALSE ||\n+ (\n+ icmpv6rpl_getPreferredParentEui64(&address) &&\n+ schedule_hasManagedTxCellToNeighbor(&address) == FALSE\n+ )\n+ ){\n+ // delete packets genereted by this module (EB and KA) from openqueue\n+ openqueue_removeAllCreatedBy(COMPONENT_ICMPv6RPL);\n+\n+ // I'm not busy sending a DIO/DAO\n+ icmpv6rpl_vars.busySendingDIO = FALSE;\n+ icmpv6rpl_vars.busySendingDAO = FALSE;\n+\n+ return;\n+ }\n+\n+ memset(&address,0,sizeof(open_addr_t));\n+\n// dont' send a DAO if you're still busy sending the previous one\nif (icmpv6rpl_vars.busySendingDAO==TRUE) {\nreturn;\n"
}
] |
C
|
BSD 3-Clause New or Revised License
|
openwsn-berkeley/openwsn-fw
|
FW-782. don't send any packet before having a managed cell.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.