Merge pull request #2939 from gebart/pr/whitespace-fixes1

Whitespace fixes
dev/timer
Oleg Hahm 8 years ago
commit e9145fb911

5
.gitattributes vendored

@ -1 +1,6 @@
*.a binary
# Default conflict marker size is 7 which causes some of the headings in
# release-notes.txt to trigger git diff --check: 'leftover conflict marker'
# when the heading is exactly 7 characters long.
*.md conflict-marker-size=100
*.txt conflict-marker-size=100

@ -22,4 +22,3 @@
/* make Travis happy: #ifdef __cplusplus extern "C" { #endif */
#endif /* PERIPH_CONF_H */

@ -5,30 +5,30 @@ linux_checkid() {
}
windows_flash_fm() {
echo "Checking FTDI device on COM${1}"
PORTINFO=`${BASEDIR}/../../../tools/windows/ftdiinfo/bin/Debug/ftdiinfo.exe /l COM${1}`
PORTCHECK=`echo ${PORTINFO} | awk '{ print $1 }'`
BOARDCHECK=`echo ${PORTINFO} | awk '{ print $3 }'`
SERIAL=`echo ${PORTINFO} | awk '{ print $2 }'`
if [ "${PORTCHECK}" != "COM${1}" ]; then
echo " port mismatch / ftdiinfo failed"
exit 1
fi
if [ "${BOARDCHECK}" != "\"${FTDI_ID}\"" ]; then
echo " target mismatch: target board is \"${FTDI_ID}\", connected is ${BOARDCHECK}"
exit 1
fi
echo "Flashing ${HEXFILE} to COM${1} (${BOARDCHECK} serial ${SERIAL})"
# Using FlashMagic on Windows (in separate window)
cmd /C start "FlashMagic ${HEXFILE} to ${BOARDCHECK} on COM${1}" fm.exe "COM(${1}, 230400) DEVICE(LPC2387, 16.000000) HARDWARE(BOOTEXEC, 50, 100) HIGHSPEED(0, 230400) ERASEUSED(${HEXFILE}, PROTECTISP) HEXFILE(${HEXFILE}, NOCHECKSUMS, NOFILL, PROTECTISP) RESET"
echo "Checking FTDI device on COM${1}"
PORTINFO=`${BASEDIR}/../../../tools/windows/ftdiinfo/bin/Debug/ftdiinfo.exe /l COM${1}`
PORTCHECK=`echo ${PORTINFO} | awk '{ print $1 }'`
BOARDCHECK=`echo ${PORTINFO} | awk '{ print $3 }'`
SERIAL=`echo ${PORTINFO} | awk '{ print $2 }'`
if [ "${PORTCHECK}" != "COM${1}" ]; then
echo " port mismatch / ftdiinfo failed"
exit 1
fi
if [ "${BOARDCHECK}" != "\"${FTDI_ID}\"" ]; then
echo " target mismatch: target board is \"${FTDI_ID}\", connected is ${BOARDCHECK}"
exit 1
fi
echo "Flashing ${HEXFILE} to COM${1} (${BOARDCHECK} serial ${SERIAL})"
# Using FlashMagic on Windows (in separate window)
cmd /C start "FlashMagic ${HEXFILE} to ${BOARDCHECK} on COM${1}" fm.exe "COM(${1}, 230400) DEVICE(LPC2387, 16.000000) HARDWARE(BOOTEXEC, 50, 100) HIGHSPEED(0, 230400) ERASEUSED(${HEXFILE}, PROTECTISP) HEXFILE(${HEXFILE}, NOCHECKSUMS, NOFILL, PROTECTISP) RESET"
}
windows_flash_openocd() {
echo "Flashing ${HEXFILE} through JTAG"
# Using OpenOcd on Windows
#cmd /C start "OpenOCD ${HEXFILE} to ${BOARDCHECK}"
bash -x ${OPENOCD} ${OPENOCD_IF} "mt_flash ${HEXFILE}; reset run; shutdown"
echo "Flashing ${HEXFILE} through JTAG"
# Using OpenOcd on Windows
#cmd /C start "OpenOCD ${HEXFILE} to ${BOARDCHECK}"
bash -x ${OPENOCD} ${OPENOCD_IF} "mt_flash ${HEXFILE}; reset run; shutdown"
}
TEMP=`getopt -a -o b:i:p:f:: --long basedir:,id:,ports:,file:,openocd:,openocd-if:,xxx:: \
@ -40,31 +40,31 @@ if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while true ; do
echo $1: $2
case "$1" in
-b|--basedir) BASEDIR=$2 ; shift 2 ;;
-i|--id) FTDI_ID=$2; shift 2 ;;
-p|--ports) PORTS=`echo $2 | sed -e 's:,: :g'`; shift 2 ;;
--openocd) OPENOCD=$2; shift 2 ;;
--openocd-if) OPENOCD_IF=$2; shift 2 ;;
--) HEXFILE=$2 ; shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
echo $1: $2
case "$1" in
-b|--basedir) BASEDIR=$2 ; shift 2 ;;
-i|--id) FTDI_ID=$2; shift 2 ;;
-p|--ports) PORTS=`echo $2 | sed -e 's:,: :g'`; shift 2 ;;
--openocd) OPENOCD=$2; shift 2 ;;
--openocd-if) OPENOCD_IF=$2; shift 2 ;;
--) HEXFILE=$2 ; shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
if [ "${OS}" = "Windows_NT" ]; then
WINDOWS=1
WINDOWS=1
fi
FLASHUTIL_SHELL=${FLASHUTIL_SHELL:-"xterm -e"}
if [ "x${WINDOWS}x" = "xx" ]; then
echo Pausing terminal
${BASEDIR}/termctrl.sh pause
echo Pausing terminal
${BASEDIR}/termctrl.sh pause
else
HEXFILE=`echo ${HEXFILE} | sed -e 's:/:\\\\:g'`
BASEDIRWIN=`echo ${BASEDIR} | sed -e 's:/:\\\\:g'`
HEXFILE=`echo ${HEXFILE} | sed -e 's:/:\\\\:g'`
BASEDIRWIN=`echo ${BASEDIR} | sed -e 's:/:\\\\:g'`
fi
pids=""
@ -73,41 +73,41 @@ pids=""
# for OpenOCD let the user verify, that the correct board is connected
#
if [ ${PORTS} = "openocd" ]; then
[ "$OPENOCD" != "" ] || exit 1
[ "$OPENOCD_IF" != "" ] || exit 1
[ "$OPENOCD" != "" ] || exit 1
[ "$OPENOCD_IF" != "" ] || exit 1
# echo -n "Is the board connected to the JTAG a '${FTDI_ID}' (y/n)? "
# read REPLY
# [ "$REPLY" = "y" ] || exit 1
# read REPLY
# [ "$REPLY" = "y" ] || exit 1
fi
#
# start a flasher for each port
#
for PORT in $PORTS; do
if [ "x${WINDOWS}x" != "xx" ]; then
if [ "${PORT}" = "openocd" ]; then
windows_flash_openocd
else
windows_flash_fm ${PORT}
fi
else
if [ "${PORT}" = "openocd" ]; then
${OPENOCD} ${OPENOCD_IF} "mt_flash ${HEXFILE}; reset run; shutdown"
else
echo Flashing ${HEXFILE} to ${PORT}
# using homemade lpc2k_pgm else
${FLASHUTIL_SHELL} "${BASEDIR}/bin/lpc2k_pgm ${PORT} ${HEXFILE}; sleep 2" &
pids="${pids} $!"
if [ "x${WINDOWS}x" != "xx" ]; then
if [ "${PORT}" = "openocd" ]; then
windows_flash_openocd
else
windows_flash_fm ${PORT}
fi
fi
else
if [ "${PORT}" = "openocd" ]; then
${OPENOCD} ${OPENOCD_IF} "mt_flash ${HEXFILE}; reset run; shutdown"
else
echo Flashing ${HEXFILE} to ${PORT}
# using homemade lpc2k_pgm else
${FLASHUTIL_SHELL} "${BASEDIR}/bin/lpc2k_pgm ${PORT} ${HEXFILE}; sleep 2" &
pids="${pids} $!"
fi
fi
done
### wait for all flasher processes to finish
echo Waiting until all devices have been programmed...
for pid in "${pids}"; do
wait ${pid}
wait ${pid}
done
if [ "x${WINDOWS}x" = "xx" ]; then
echo Resuming terminal
${BASEDIR}/termctrl.sh continue
echo Resuming terminal
${BASEDIR}/termctrl.sh continue
fi

@ -1,2 +1 @@
USEMODULE += msp430_common

@ -170,7 +170,7 @@ extern "C" {
int tm_isdst;
};
/* We have to provide clock_t / CLOCKS_PER_SEC so that libstdc++-v3 can
be built. We define CLOCKS_PER_SEC via a symbol _CLOCKS_PER_SEC_
so that the user can provide the value on the link line, which should

@ -94,4 +94,3 @@ static void cpu_clock_init(void)
while (!SYS_CTRL->CLOCK_STAbits.SYNC_32K);
#endif
}

@ -9,85 +9,85 @@
/* specify the LPC2387 memory areas (see LPC2387 datasheet page 15) */
MEMORY
{
flash : ORIGIN = 0, LENGTH = 504K /* FLASH ROM 512kByte without ISP bootloader*/
flash : ORIGIN = 0, LENGTH = 504K /* FLASH ROM 512kByte without ISP bootloader*/
infomem : ORIGIN = 0x0007D000, LENGTH = 4K /* Last sector in FLASH ROM for config data */
ram_battery : ORIGIN = 0xE0084000, LENGTH = 2K /* Battery RAM */
ram : ORIGIN = 0x40000000, LENGTH = 64K /* LOCAL ON-CHIP STATIC RAM */
ram_usb : ORIGIN = 0x7FD00000, LENGTH = 16K /* USB RAM !!! first 1024 bytes are occupied from GPDMA for MCI */
ram_ethernet : ORIGIN = 0x7FE00000, LENGTH = 16K /* ethernet RAM */
ram_battery : ORIGIN = 0xE0084000, LENGTH = 2K /* Battery RAM */
ram : ORIGIN = 0x40000000, LENGTH = 64K /* LOCAL ON-CHIP STATIC RAM */
ram_usb : ORIGIN = 0x7FD00000, LENGTH = 16K /* USB RAM !!! first 1024 bytes are occupied from GPDMA for MCI */
ram_ethernet : ORIGIN = 0x7FE00000, LENGTH = 16K /* ethernet RAM */
}
__stack_und_size = 4; /* stack for "undefined instruction" interrupts */
__stack_abt_size = 4; /* stack for "abort" interrupts */
__stack_fiq_size = 64; /* stack for "FIQ" interrupts */
__stack_irq_size = 400; /* stack for "IRQ" normal interrupts */
__stack_svc_size = 400; /* stack for "SVC" supervisor mode */
__stack_usr_size = 4096; /* stack for user operation (kernel init) */
__stack_und_size = 4; /* stack for "undefined instruction" interrupts */
__stack_abt_size = 4; /* stack for "abort" interrupts */
__stack_fiq_size = 64; /* stack for "FIQ" interrupts */
__stack_irq_size = 400; /* stack for "IRQ" normal interrupts */
__stack_svc_size = 400; /* stack for "SVC" supervisor mode */
__stack_usr_size = 4096; /* stack for user operation (kernel init) */
__stack_size = __stack_und_size + __stack_abt_size + __stack_fiq_size + __stack_irq_size + __stack_svc_size + __stack_usr_size;
/* now define the output sections */
SECTIONS
{
.text : /* collect all sections that should go into FLASH after startup */
{
KEEP(*(.vectors)) /* Exception Vectors and branch table >= 64 bytes */
. = ALIGN(64);
KEEP(*(.init))
KEEP(*(.init0)) /* Start here after reset. */
KEEP(*(.init1))
KEEP(*(.init2)) /* Copy data loop */
KEEP(*(.init3))
KEEP(*(.init4)) /* Clear bss */
KEEP(*(.init5))
KEEP(*(.init6)) /* C++ constructors. */
KEEP(*(.init7))
KEEP(*(.init8))
KEEP(*(.init9)) /* Call main(). */
*(.text) /* all .text sections (code) */
*(.text.*)
*(.gnu.linkonce.t.*)
. = ALIGN(4);
__commands_start = .;
KEEP(*(.commands)) /* command table */
__commands_end = .;
. = ALIGN(4);
__cfgspec_start = .;
KEEP(*(.cfgspec)) /* configuration spec table */
__cfgspec_end = .;
. = ALIGN(4);
__ctors_start = .;
PROVIDE(_os_ctor_start = .);
KEEP(*(.ctors));
KEEP(*(.init_array))
PROVIDE(_os_ctor_end = .);
__ctors_end = .;
KEEP(*(.dtors));
LONG (0);
*(.rodata .rodata.*) /* all .rodata sections (constants, strings, etc.) */
*(.gnu.linkonce.r.*)
*(.glue_7) /* all .glue_7 sections, see https://gcc.gnu.org/ml/gcc-help/2009-03/msg00306.html */
*(.glue_7t) /* all .glue_7t sections */
KEEP(*(.fini9))
KEEP(*(.fini8))
KEEP(*(.fini7))
KEEP(*(.fini6)) /* C++ destructors. */
KEEP(*(.fini5))
KEEP(*(.fini4))
KEEP(*(.fini3))
KEEP(*(.fini2))
KEEP(*(.fini1))
KEEP(*(.fini0)) /* Infinite loop after program termination. */
KEEP(*(.fini))
*(.gcc_except_table)
} >flash /* put all the above into FLASH */
. = ALIGN(4);
.text : /* collect all sections that should go into FLASH after startup */
{
KEEP(*(.vectors)) /* Exception Vectors and branch table >= 64 bytes */
. = ALIGN(64);
KEEP(*(.init))
KEEP(*(.init0)) /* Start here after reset. */
KEEP(*(.init1))
KEEP(*(.init2)) /* Copy data loop */
KEEP(*(.init3))
KEEP(*(.init4)) /* Clear bss */
KEEP(*(.init5))
KEEP(*(.init6)) /* C++ constructors. */
KEEP(*(.init7))
KEEP(*(.init8))
KEEP(*(.init9)) /* Call main(). */
*(.text) /* all .text sections (code) */
*(.text.*)
*(.gnu.linkonce.t.*)
. = ALIGN(4);
__commands_start = .;
KEEP(*(.commands)) /* command table */
__commands_end = .;
. = ALIGN(4);
__cfgspec_start = .;
KEEP(*(.cfgspec)) /* configuration spec table */
__cfgspec_end = .;
. = ALIGN(4);
__ctors_start = .;
PROVIDE(_os_ctor_start = .);
KEEP(*(.ctors));
KEEP(*(.init_array))
PROVIDE(_os_ctor_end = .);
__ctors_end = .;
KEEP(*(.dtors));
LONG (0);
*(.rodata .rodata.*) /* all .rodata sections (constants, strings, etc.) */
*(.gnu.linkonce.r.*)
*(.glue_7) /* all .glue_7 sections, see https://gcc.gnu.org/ml/gcc-help/2009-03/msg00306.html */
*(.glue_7t) /* all .glue_7t sections */
KEEP(*(.fini9))
KEEP(*(.fini8))
KEEP(*(.fini7))
KEEP(*(.fini6)) /* C++ destructors. */
KEEP(*(.fini5))
KEEP(*(.fini4))
KEEP(*(.fini3))
KEEP(*(.fini2))
KEEP(*(.fini1))
KEEP(*(.fini0)) /* Infinite loop after program termination. */
KEEP(*(.fini))
*(.gcc_except_table)
} >flash /* put all the above into FLASH */
. = ALIGN(4);
/* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .;
@ -97,7 +97,7 @@ SECTIONS
} >flash
__exidx_end = .;
_etext = . ; /* define a global symbol _etext just after the last code byte */
_etext = . ; /* define a global symbol _etext just after the last code byte */
.config :
{
@ -106,65 +106,65 @@ SECTIONS
} >infomem
. = ALIGN(4);
/**************************************************************************
* RAM
**************************************************************************/
.ctors (NOLOAD) :
{
. = ALIGN(4096);
start_ctors = .;
*(.init_array);
*(.ctors);
end_ctors = .;
} >ram
.dtors (NOLOAD) :
{
. = ALIGN(4096);
start_dtors = .;
*(.fini_array);
*(.dtors);
end_dtors = .;
} >ram
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
PROVIDE(__fiq_handler = .);
*(.fiq)
*(.noinit)
} > ram
. = ALIGN(4);
__noinit_end = .;
/*
* collect all zero initialized sections that go into RAM
*/
.bss (NOLOAD) :
{
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
__bss_start = .; /* define a global symbol marking the start of the .bss section */
*(.bss*) /* all .bss sections */
*(COMMON)
} > ram /* put all the above in RAM (it will be cleared in the startup code */
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
__bss_end = . ; /* define a global symbol marking the end of the .bss section */
/*
* collect all initialized .data sections that go into RAM
* initial values get placed at the end of .text in flash
*/
.data : AT (_etext)
{
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_data = .; /* create a global symbol marking the start of the .data section */
*(.data .data.*) /* all .data sections */
*(.gnu.linkonce.d*)
/**************************************************************************
* RAM
**************************************************************************/
.ctors (NOLOAD) :
{
. = ALIGN(4096);
start_ctors = .;
*(.init_array);
*(.ctors);
end_ctors = .;
} >ram
.dtors (NOLOAD) :
{
. = ALIGN(4096);
start_dtors = .;
*(.fini_array);
*(.dtors);
end_dtors = .;
} >ram
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
PROVIDE(__fiq_handler = .);
*(.fiq)
*(.noinit)
} > ram
. = ALIGN(4);
__noinit_end = .;
/*
* collect all zero initialized sections that go into RAM
*/
.bss (NOLOAD) :
{
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
__bss_start = .; /* define a global symbol marking the start of the .bss section */
*(.bss*) /* all .bss sections */
*(COMMON)
} > ram /* put all the above in RAM (it will be cleared in the startup code */
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
__bss_end = . ; /* define a global symbol marking the end of the .bss section */
/*
* collect all initialized .data sections that go into RAM
* initial values get placed at the end of .text in flash
*/
.data : AT (_etext)
{
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_data = .; /* create a global symbol marking the start of the .data section */
*(.data .data.*) /* all .data sections */
*(.gnu.linkonce.d*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
@ -184,88 +184,88 @@ SECTIONS
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);
} >ram /* put all the above into RAM (but load the LMA copy into FLASH) */
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_edata = .; /* define a global symbol marking the end of the .data section */
} >ram /* put all the above into RAM (but load the LMA copy into FLASH) */
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_edata = .; /* define a global symbol marking the end of the .data section */
/*
* Exception frames (newer linker versions generate these but they use of
* most of the RAM.
*/
/DISCARD/ : /* discard exception frames */
/*
* Exception frames (newer linker versions generate these but they use of
* most of the RAM.
*/
/DISCARD/ : /* discard exception frames */
{
*(.eh_*)
}
/* to enable exception frames */
/*
.eh_frame :
{
KEEP (*(.eh_frame))
} > ram
. = ALIGN(4);
*/
_end = .; /* define a global symbol marking the end of application RAM */
__heap1_size = ORIGIN(ram) + LENGTH(ram) - . - __stack_size;
.heap1 (NOLOAD) :
{
PROVIDE(__heap1_start = .);
. = . + __heap1_size;
PROVIDE(__heap1_max = .);
} > ram
/*
* Stacks
*/
.stack (NOLOAD) :
{
PROVIDE(__stack_start = .);
. = . + __stack_usr_size;
__stack_usr_start = .;
. = . + __stack_und_size;
__stack_und_start = .;
. = . + __stack_fiq_size;
__stack_fiq_start = .;
. = . + __stack_irq_size;
__stack_irq_start = .;
. = . + __stack_abt_size;
__stack_abt_start = .;
. = . + __stack_svc_size;
__stack_svc_start = .;
PROVIDE(__stack_end = .);
} > ram
__heap2_size = LENGTH(ram_ethernet);
.heap2 (NOLOAD) :
{
PROVIDE(__heap2_start = . );
. = . + __heap2_size;
PROVIDE(__heap2_max = .); /* _heap shall always be < _heap_max */
} > ram_ethernet
. = ORIGIN(ram_usb);
.usbdata (NOLOAD) : /* USB RAM section, may be used otherwise if USB is disabled */
{
*(.usbdata)
} > ram_usb
.heap3 ALIGN(0x1000) (NOLOAD) :
{
__heap3_size = ORIGIN(ram_usb) + LENGTH(ram_usb) - ABSOLUTE(.);
PROVIDE(__heap3_start = . );
. += __heap3_size;
PROVIDE(__heap3_max = .);
} > ram_usb
__heap_size = SIZEOF(.heap3);
.batteryram (NOLOAD) : /* battery ram stays on during powerdown but needs to be handled specially */
{
*(.batteryram)
} > ram_battery
/* to enable exception frames */
/*
.eh_frame :
{
KEEP (*(.eh_frame))
} > ram
. = ALIGN(4);
*/
_end = .; /* define a global symbol marking the end of application RAM */
__heap1_size = ORIGIN(ram) + LENGTH(ram) - . - __stack_size;
.heap1 (NOLOAD) :
{
PROVIDE(__heap1_start = .);
. = . + __heap1_size;
PROVIDE(__heap1_max = .);
} > ram
/*
* Stacks
*/
.stack (NOLOAD) :
{
PROVIDE(__stack_start = .);
. = . + __stack_usr_size;
__stack_usr_start = .;
. = . + __stack_und_size;
__stack_und_start = .;
. = . + __stack_fiq_size;
__stack_fiq_start = .;
. = . + __stack_irq_size;
__stack_irq_start = .;
. = . + __stack_abt_size;
__stack_abt_start = .;
. = . + __stack_svc_size;
__stack_svc_start = .;
PROVIDE(__stack_end = .);
} > ram
__heap2_size = LENGTH(ram_ethernet);
.heap2 (NOLOAD) :
{
PROVIDE(__heap2_start = . );
. = . + __heap2_size;
PROVIDE(__heap2_max = .); /* _heap shall always be < _heap_max */
} > ram_ethernet
. = ORIGIN(ram_usb);
.usbdata (NOLOAD) : /* USB RAM section, may be used otherwise if USB is disabled */
{
*(.usbdata)
} > ram_usb
.heap3 ALIGN(0x1000) (NOLOAD) :
{
__heap3_size = ORIGIN(ram_usb) + LENGTH(ram_usb) - ABSOLUTE(.);
PROVIDE(__heap3_start = . );
. += __heap3_size;
PROVIDE(__heap3_max = .);
} > ram_usb
__heap_size = SIZEOF(.heap3);
.batteryram (NOLOAD) : /* battery ram stays on during powerdown but needs to be handled specially */
{
*(.batteryram)
} > ram_battery
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -745,11 +745,11 @@ typedef struct
__IO uint32_t CSGCM7R; /*!< CRYP GCM/GMAC context swap register 7, Address offset: 0x8C */
} CRYP_TypeDef;
/**
/**
* @brief HASH
*/
typedef struct
typedef struct
{
__IO uint32_t CR; /*!< HASH control register, Address offset: 0x00 */
__IO uint32_t DIN; /*!< HASH data input register, Address offset: 0x04 */
@ -761,13 +761,13 @@ typedef struct
__IO uint32_t CSR[54]; /*!< HASH context swap registers, Address offset: 0x0F8-0x1CC */
} HASH_TypeDef;
/**
/**
* @brief HASH_DIGEST
*/
typedef struct
typedef struct
{
__IO uint32_t HR[8]; /*!< HASH digest registers, Address offset: 0x310-0x32C */
__IO uint32_t HR[8]; /*!< HASH digest registers, Address offset: 0x310-0x32C */
} HASH_DIGEST_TypeDef;
/**
@ -831,11 +831,11 @@ typedef struct
__IO uint32_t DTHRCTL; /*!< dev thr Address offset : 0x830 */
__IO uint32_t DIEPEMPMSK; /*!< dev empty msk Address offset : 0x834 */
__IO uint32_t DEACHINT; /*!< dedicated EP interrupt Address offset : 0x838 */
__IO uint32_t DEACHMSK; /*!< dedicated EP msk Address offset : 0x83C */
__IO uint32_t DEACHMSK; /*!< dedicated EP msk Address offset : 0x83C */
uint32_t Reserved40; /*!< dedicated EP mask Address offset : 0x840 */
__IO uint32_t DINEP1MSK; /*!< dedicated EP mask Address offset : 0x844 */
uint32_t Reserved44[15]; /*!< Reserved Address offset : 0x844-0x87C */
__IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk Address offset : 0x884 */
__IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk Address offset : 0x884 */
}
USB_OTG_DeviceTypeDef;
@ -1124,7 +1124,7 @@ USB_OTG_HostChannelTypeDef;
#define DMA2_Stream4 ((DMA_Stream_TypeDef *) DMA2_Stream4_BASE)
#define DMA2_Stream5 ((DMA_Stream_TypeDef *) DMA2_Stream5_BASE)
#define DMA2_Stream6 ((DMA_Stream_TypeDef *) DMA2_Stream6_BASE)
#define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
#define DMA2_Stream7 ((DMA_Stream_TypeDef *) DMA2_Stream7_BASE)
#define CRYP ((CRYP_TypeDef *) CRYP_BASE)
#define HASH ((HASH_TypeDef *) HASH_BASE)
#define HASH_DIGEST ((HASH_DIGEST_TypeDef *) HASH_DIGEST_BASE)
@ -2830,7 +2830,7 @@ USB_OTG_HostChannelTypeDef;
#define CRYP_CR_GCM_CCMPH ((uint32_t)0x00030000)
#define CRYP_CR_GCM_CCMPH_0 ((uint32_t)0x00010000)
#define CRYP_CR_GCM_CCMPH_1 ((uint32_t)0x00020000)
#define CRYP_CR_ALGOMODE_3 ((uint32_t)0x00080000)
#define CRYP_CR_ALGOMODE_3 ((uint32_t)0x00080000)
/****************** Bits definition for CRYP_SR register *********************/
#define CRYP_SR_IFEM ((uint32_t)0x00000001)

@ -134,4 +134,3 @@ ssize_t write(int fildes, const void *buf, size_t nbyte)
(void) nbyte;
return -1;
}

1
dist/Dockerfile vendored

@ -36,4 +36,3 @@ RUN apt-get -y install subversion curl wget python p7zip unzip
RUN mkdir -p /data/riotbuild
WORKDIR /data/riotbuild

@ -37,4 +37,3 @@ If this happens, you can add an "inline suppression" like this:
/* cppcheck-suppress passedByValue */
timex_t timex_add(const timex_t a, const timex_t b);

@ -42,7 +42,7 @@ WARNINGS=$(comm -1 -2 ${TMP_WARN} ${TMP_DOC})
ERRORS=$(comm -1 -2 ${TMP_ERR} ${TMP_DOC})
rm ${TMP_ERR} ${TMP_WARN} ${TMP_DOC}
if [ -n "${WARNINGS}" ]
then
echo "WARNING: The following modified files generate doxygen warnings:"

@ -1 +1 @@
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution\. Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution\. Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.

@ -1,2 +1 @@
__all__ = ["pytermcontroller"]

@ -30,13 +30,13 @@ class PubProtocol(Protocol):
self.factory = factory
def connectionMade(self):
print("new connection made")
print("new connection made")
def connectionLost(self, reason):
self.factory.numProtocols = self.factory.numProtocols - 1
def connectionLost(self, reason):
self.factory.clients = {key: value for key, value in self.factory.clients.items()
self.factory.clients = {key: value for key, value in self.factory.clients.items()
if value is not self.transport}
def dataReceived(self, data):
@ -53,40 +53,40 @@ class PubFactory(Factory):
def buildProtocol(self, addr):
return PubProtocol(self)
class ExperimentRunner():
def __init__(self, experiment, testbed):
self.publisher = PubFactory()
self.port = int(testbed.serverPort)
self.experiment = experiment(self.publisher, self)
self.testbed = testbed
def run(self):
signal.signal(signal.SIGINT, self.handle_sigint)
self.experiment.run()
reactor.listenTCP(self.port, self.publisher)
# clean logfiles and start nodes but don't flash nodes
self.testbed.initClean()
reactor.run()
self.testbed.initClean()
reactor.run()
def stop(self):
self.testbed.stop()
reactor.callFromThread(self.safeReactorStop)
def safeReactorStop(self):
if reactor.running:
try:
reactor.stop()
except:
print("tried to shutdown reactor twice!")
def handle_sigint(self, signal, frame):
def handle_sigint(self, signal, frame):
self.experiment.stop()
self.testbed.stop()
self.stop() # shutdown if experiment didn't already
class Experiment():
def __init__(self, factory, runner):
@ -94,65 +94,64 @@ class Experiment():
self.runner = runner
self.hostid = dict()
self.sumDelay = 0
def run(self):
print("Running preHook")
self.preHook()
print("Running experiment")
self.start()
self.start()
def start(self):
raise NotImplementedError("Inherit from Experiment and implement start")
def stop(self):
print("Running postHook")
self.postHook()
self.runner.stop()
raise NotImplementedError("Inherit from Experiment and implement start")
def stop(self):
print("Running postHook")
self.postHook()
self.runner.stop()
def preHook(self):
pass
pass
def postHook(self):
pass
pass
def readHostFile(self, path):
id = 1
with open(path) as f:
for line in f:
self.hostid[line.strip()] = id
id += 1
def sendToHost(self, host=None, cmd=""):
if host in self.factory.clients:
self.factory.clients[host].write(cmd + "\n")
else:
print("sendToHost: no such host known: " + host + " !")
def sendToAll(self, cmd=""):
for host, transport in self.factory.clients.items():
self.sendToHost(host, cmd)
self.sendToHost(host, cmd)
def pauseInSeconds(self, seconds=0):
from time import time, sleep
start = time()
while (time() - start < seconds):
sleep(seconds - (time() - start))
def callLater(self, absoluteDelay = 0.0, function = None):
reactor.callLater(absoluteDelay, function)
def waitAndCall(self, relativeDelay = 0.0, function = None):
self.sumDelay += relativeDelay
self.callLater(self.sumDelay, function)
def clientIterator(self):
return self.factory.clients.items()
def connectionByHostname(self, host=None):
if host in self.factory.clients:
return self.factory.clients[host]
@staticmethod
return self.factory.clients[host]
@staticmethod
def sendToConnection(connection, line):
connection.write(line + "\n")
connection.write(line + "\n")

@ -1,2 +1 @@
__all__ = ["testbeds"]

@ -25,49 +25,49 @@ from subprocess import call, Popen, PIPE
class Testbed():
log_dir_name = 'log'
def __init__(self):
pass
def initCleanWithFlash(self):
self.stop()
self.cleanLogs()
self.flashNodes()
self.start()
def initClean(self):
self.cleanLogs()
self.start()
def flashNodes(self):
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
def cleanLogs(self):
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
def archiveLogs(self, experiment = None):
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
def start(self):
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
def stop(self):
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
raise NotImplementedError("Inherit from Testbed and implement flashNodes")
def defaultArchivePostfix(self, experimentName = None):
if not experimentName:
experimentName = "unknown"
time = datetime.datetime.now().strftime("%Y-%m-%d_%H_%M_%S")
postfix = "-" + experimentName +"_" + time
return postfix
postfix = "-" + experimentName +"_" + time
return postfix
def printAndCall(self, cmdString):
print(cmdString)
call(cmdString, shell=True)
class DESTestbed(Testbed):
def __init__(self, serverHost = None, serverPort=None, userName = None, flasher = None,
print(cmdString)
call(cmdString, shell=True)
class DESTestbed(Testbed):
def __init__(self, serverHost = None, serverPort=None, userName = None, flasher = None,
hexfilePath = None, pyterm = None, logFilePath = None, hostFile = None):
self.serverHost = serverHost
self.serverPort = str(serverPort)
@ -77,25 +77,25 @@ class DESTestbed(Testbed):
self.pyterm = pyterm
self.logFilePath = logFilePath
self.hostFile = hostFile
def flashNodes(self):
def flashNodes(self):
self.printAndCall("parallel-ssh -h %s -l %s 'python %s'" % (self.hostFile, self.userName, self.flasher))
def cleanLogs(self):
def cleanLogs(self):
self.printAndCall("rm -rf %s/*.log" % (self.logFilePath))
def archiveLogs(self, postfix = None):
def archiveLogs(self, postfix = None):
postfix = self.defaultArchivePostfix(postfix)
logDir = self.logFilePath.split("/")[-1]
self.printAndCall("cd %s/..; tar -cjf archived_logs%s.tar.bz2 %s/*.log" % (self.logFilePath, postfix, logDir))
def start(self):
def start(self):
self.printAndCall("parallel-ssh -h %s -l %s 'screen -S pyterm -d -m python %s -ln %s'" % (self.hostFile, self.userName, self.pyterm, self.log_dir_name))
def stop(self):
def stop(self):
self.printAndCall("parallel-ssh -h %s -l %s 'screen -X -S pyterm quit'" % (self.hostFile, self.userName))
class LocalTestbed(Testbed):
class LocalTestbed(Testbed):
def __init__(self, serverHost = None, serverPort=None, flasher = None, hexfilePath = None, pyterm = None, logFilePath = None):
self.serverHost = serverHost
self.serverPort = str(serverPort)
@ -103,34 +103,34 @@ class LocalTestbed(Testbed):
self.hexFilePath = hexfilePath
self.pyterm = pyterm
self.logFilePath = logFilePath
def findPorts(self):
devlist = os.listdir("/dev/")
regex = re.compile('^ttyUSB')
devlist = os.listdir("/dev/")
regex = re.compile('^ttyUSB')
return sorted([port for port in devlist if regex.match(port)])
def flashNodes(self):
def flashNodes(self):
self.printAndCall("python %s %s" % (self.flasher, self.hexFilePath))
def cleanLogs(self):
def cleanLogs(self):
self.printAndCall("rm -rf %s/*.log" % (self.logFilePath))
def archiveLogs(self, postfix = None):
def archiveLogs(self, postfix = None):
postfix = self.defaultArchivePostfix(postfix)
logDir = self.logFilePath.split("/")[-1]
self.printAndCall("cd %s/..; tar -cjf archived_logs%s.tar.bz2 %s/*.log" % (self.logFilePath, postfix, logDir))
def start(self):
portList = self.findPorts()
for port in portList:
for port in portList:
self.printAndCall("screen -S pyterm-%s -d -m python %s -H %s -rn %s -p /dev/%s -ln %s" % (port, self.pyterm, port, port, port, self.log_dir_name))
def stop(self):
portList = self.findPorts()
for port in portList:
for port in portList:
self.printAndCall("screen -X -S pyterm-%s quit" % (port))
class DesVirtTestbed(Testbed):
class DesVirtTestbed(Testbed):
def __init__(self, serverHost = None, serverPort=None, desvirtPath = None, topologyName = None, pyterm = None, logFilePath = None):
self.serverHost = serverHost
self.serverPort = str(serverPort)
@ -139,10 +139,10 @@ class DesVirtTestbed(Testbed):
self.pyterm = pyterm
self.logFilePath = logFilePath
self.namePortList = []
def findPorts(self):
def findPorts(self):
return self.namePortList
def startDesVirtNetwork(self):
print "executing: " + "./vnet --start --name " + self.topologyName + " in: " + self.desvirtPath
call("sh -c \"./vnet --define --name " + self.topologyName + "\"", cwd=self.desvirtPath, shell=True)
@ -157,30 +157,27 @@ class DesVirtTestbed(Testbed):
self.namePortList = sorted(self.namePortList)
for tuple in self.namePortList:
print "name: " + tuple[0] + " port: " + str(tuple[1])
def stopDesVirtNetwork(self):
call("sh -c \"./vnet --stop --name " + self.topologyName + "\"", cwd=self.desvirtPath, shell=True)
call("sh -c \"./vnet --stop --name " + self.topologyName + "\"", cwd=self.desvirtPath, shell=True)
def flashNodes(self):
def flashNodes(self):
pass
def cleanLogs(self):
def cleanLogs(self):
self.printAndCall("rm -rf %s/*.log" % (self.logFilePath))
def archiveLogs(self, postfix = None):
def archiveLogs(self, postfix = None):
postfix = self.defaultArchivePostfix(postfix)
logDir = self.logFilePath.split("/")[-1]
self.printAndCall("cd %s/..; tar -cjf archived_logs%s.tar.bz2 %s/*.log" % (self.logFilePath, postfix, logDir))
def start(self):
for node in self.namePortList:
for node in self.namePortList:
self.printAndCall("screen -S pyterm-%s -d -m python %s -H %s -rn %s -ts %s -ln %s" % (node[0], self.pyterm, node[0], node[0], node[1], self.log_dir_name))
def stop(self):
print "stop called"
for node in self.namePortList:
for node in self.namePortList:
self.printAndCall("screen -X -S pyterm-%s quit" % (node[0]))
self.stopDesVirtNetwork()

@ -55,4 +55,3 @@ For windows you can use the optional third argument to output to a
.pcap:
$ ./rftestrx2pcap.py /dev/ttyUSB1 26 foo.pcap

@ -33,41 +33,41 @@ import re
import serial
if len(sys.argv) < 3:
sys.stderr.write( "Usage: %s tty channel [outfile]\n" %(sys.argv[0]))
sys.stderr.write( " channel = 11-26\n")
sys.exit(2)
sys.stderr.write( "Usage: %s tty channel [outfile]\n" %(sys.argv[0]))
sys.stderr.write( " channel = 11-26\n")
sys.exit(2)
# change the channel
try:
serport = serial.Serial(sys.argv[1], baudrate=115200, dsrdtr=0, rtscts=0, timeout=1)
serport.setDTR(0)
serport.setRTS(0)
serport = serial.Serial(sys.argv[1], baudrate=115200, dsrdtr=0, rtscts=0, timeout=1)
serport.setDTR(0)
serport.setRTS(0)
except IOError:
print "error opening port"
sys.exit(2)
print "error opening port"
sys.exit(2)
time.sleep(1)
chanstr = ''
sys.stderr.write('chan %s\n' % sys.argv[2])
serport.write('chan %s\n' % sys.argv[2])
while 1:
c = serport.read(1)
if (c == '\n'):
chanstr = ''
continue
chanstr += c
m = re.match(".*channel: (\w+)", chanstr)
if m:
chan = int(m.group(1))
sys.stderr.write(chanstr + '\n')
break
c = serport.read(1)
if (c == '\n'):
chanstr = ''
continue
chanstr += c
m = re.match(".*channel: (\w+)", chanstr)
if m:
chan = int(m.group(1))
sys.stderr.write(chanstr + '\n')
break
try:
sys.stderr.write('writing to file %s \n' % (sys.argv[3]))
outfile = open(sys.argv[3], 'w+b')
sys.stderr.write('writing to file %s \n' % (sys.argv[3]))
outfile = open(sys.argv[3], 'w+b')
except IndexError:
outfile = sys.stdout
outfile = sys.stdout
sys.stderr.write("RX: 0\r")
@ -88,39 +88,39 @@ fileempty = 1
newpacket = 0
try:
while 1:
line = serport.readline().rstrip()
m_rftestline = re.match(".*rftest-rx --- len 0x(\w\w).*", line)
if m_rftestline:
newpacket = 1
t = time.time()
sec = int(t)
usec = (t - sec) * 100000
length = int(m_rftestline.group(1), 16)
continue
# if this is a new packet, add a packet header
if newpacket == 1:
newpacket = 0
outfile.write(pack('<LLLL',sec,usec,length,length))
outfile.flush()
count += 1
sys.stderr.write("RX: %d\r" % count)
# clear file empty flag
if fileempty:
fileempty = 0
if fileempty == 0 :
# write payload
for d in line.split(' '):
# do a match because their might be a \r floating around
m = re.match('.*(\w\w).*', d)
if m:
outfile.write(pack('<B', int(m.group(1),16)))
outfile.flush()
while 1:
line = serport.readline().rstrip()
m_rftestline = re.match(".*rftest-rx --- len 0x(\w\w).*", line)
if m_rftestline:
newpacket = 1
t = time.time()
sec = int(t)
usec = (t - sec) * 100000
length = int(m_rftestline.group(1), 16)
continue
# if this is a new packet, add a packet header
if newpacket == 1:
newpacket = 0
outfile.write(pack('<LLLL',sec,usec,length,length))
outfile.flush()
count += 1
sys.stderr.write("RX: %d\r" % count)
# clear file empty flag
if fileempty:
fileempty = 0
if fileempty == 0 :
# write payload
for d in line.split(' '):
# do a match because their might be a \r floating around
m = re.match('.*(\w\w).*', d)
if m:
outfile.write(pack('<B', int(m.group(1),16)))
outfile.flush()
except KeyboardInterrupt:
# cn.close()
sys.exit(2)
# cn.close()
sys.exit(2)

@ -1,138 +1,138 @@
/*
* Copyright (C) 2014 PHYTEC Messtechnik GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup drivers_hdc1000 HDC1000 Humidity and Temperature Sensor
* @ingroup drivers
* @brief Driver for the Texas Instruments HDC1000
* Humidity and Temperature Sensor.
* The driver will initialize the sensor for best
* resolution (14 bit). Currently the driver doesn't use the heater.
* Temperature and humidity are acquired in sequence.
* The sensor is always in sleep mode. The measurement must
* be started by a write access to the address 0x00
* (HDC1000_TEMPERATURE). After completing the measurement
* the sensor will return to sleep mode. Typical
* Conversion Time by 14 bit resolution is 6.50ms
* for humidity and 6.35ms for temperature.
* HDC1000_CONVERSION_TIME is twice as large to prevent
* the problems with timer resolution.
*
* @{
*
* @file
* @brief Interface definition for the HDC1000 sensor driver.
*
* @author Johann Fischer <j.fischer@phytec.de>
*/
#ifndef HDC1000_H
#define HDC1000_H
#include <stdint.h>
#include <stdbool.h>
#include "periph/i2c.h"
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef HDC1000_I2C_ADDRESS
#define HDC1000_I2C_ADDRESS 0x43 /**< Default Device Address */
#endif
#ifndef HDC1000_CONVERSION_TIME
#define HDC1000_CONVERSION_TIME 26000 /**< Default Conversion Time */
#endif
/**
* @brief Device descriptor for HDC1000 sensors.
*/
typedef struct {
i2c_t i2c; /**< I2C device the sensor is connected to */
uint8_t addr; /**< the sensor's slave address on the I2C bus */
bool initialized; /**< sensor status, true if sensor is initialized */
} hdc1000_t;
/**
* @brief HDC1000 sensor test.
* This function looks for Manufacturer ID of the HDC1000 sensor.
*
* @param[in] dev device descriptor of sensor
*
* @return 0 on success
* @return -1 on error
*/
int hdc1000_test(hdc1000_t *dev);
/**
* @brief Initialise the HDC1000 sensor driver.
* 14 bit resolution, heater off, temperature and humidity
* are acquired in sequence.
*
* @param[out] dev device descriptor of sensor to initialize
* @param[in] i2c I2C bus the sensor is connected to
* @param[in] address sensor's I2C slave address
*
* @return 0 on success
* @return -1 if initialization of I2C bus failed
* @return -2 if sensor test failed
* @return -3 if sensor configuration failed
*/
int hdc1000_init(hdc1000_t *dev, i2c_t i2c, uint8_t address);
/**
* @brief Reset the HDC1000 sensor. After that sensor should be reinitialized.
*
* @param[out] dev device descriptor of sensor to reset
*
* @return 0 on success
* @return -1 on error
*/