1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

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

Whitespace fixes
This commit is contained in:
Oleg Hahm 2015-05-09 23:46:31 +02:00
commit e9145fb911
43 changed files with 16389 additions and 16359 deletions

5
.gitattributes vendored
View File

@ -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

View File

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

View File

@ -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 "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 "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 ;;
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
--) 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

View File

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

View File

@ -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

View File

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

View File

@ -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.*)
.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);
. = 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);
__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 */
*(.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))
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)
*(.gcc_except_table)
} >flash /* put all the above into FLASH */
. = ALIGN(4);
} >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
**************************************************************************/
/**************************************************************************
* RAM
**************************************************************************/
.ctors (NOLOAD) :
{
. = ALIGN(4096);
start_ctors = .;
*(.init_array);
*(.ctors);
end_ctors = .;
} >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
.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 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 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*)
/*
* 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);
*/
/* to enable exception frames */
/*
.eh_frame :
{
KEEP (*(.eh_frame))
} > ram
. = ALIGN(4);
*/
_end = .; /* define a global symbol marking the end of application RAM */
_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
__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 = .);
/*
* 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 = .;
. = . + __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
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
__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
. = 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);
.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
.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

View File

@ -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)

View File

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

1
dist/Dockerfile vendored
View File

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

View File

@ -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);

View File

@ -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:"

View File

@ -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\.

View File

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

View File

@ -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")

View File

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

View File

@ -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)
def flashNodes(self):
def stopDesVirtNetwork(self):
call("sh -c \"./vnet --stop --name " + self.topologyName + "\"", cwd=self.desvirtPath, shell=True)
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()

View File

@ -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

View File

@ -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()
while 1:
line = serport.readline().rstrip()
m_rftestline = re.match(".*rftest-rx --- len 0x(\w\w).*", line)
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()
if m_rftestline:
newpacket = 1
t = time.time()
sec = int(t)
usec = (t - sec) * 100000
length = int(m_rftestline.group(1), 16)
continue
count += 1
sys.stderr.write("RX: %d\r" % count)
# 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()
# 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()
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)

View File

@ -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
*/
int hdc1000_reset(hdc1000_t *dev);
/**
* @brief Trigger the measurements.
* Conversion Time by 14 bit resolution is 6.50ms.
*
* @param[in] dev device descriptor of sensor
*
* @return 0 on success
* @return -1 on error
*/
int hdc1000_startmeasure(hdc1000_t *dev);
/**
* @brief Read sensor's data.
*
* @param[in] dev device descriptor of sensor
* @param[out] rawtemp raw temperature value
* @param[out] rawhum raw humidity value
*
* @return 0 on success
* @return -1 on error
*/
int hdc1000_read(hdc1000_t *dev, uint16_t *rawtemp, uint16_t *rawhum);
/**
* @brief Convert raw sensor values to temperature and humidity.
*
* @param[in] rawtemp raw temperature value
* @param[in] rawhum raw humidity value
* @param[out] temp converted temperature*100
* @param[out] hum converted humidity*100
*/
void hdc1000_convert(uint16_t rawtemp, uint16_t rawhum, int *temp, int *hum);
#ifdef __cplusplus
}
#endif
#endif
/** @} */
/*
* 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
*/
int hdc1000_reset(hdc1000_t *dev);
/**
* @brief Trigger the measurements.
* Conversion Time by 14 bit resolution is 6.50ms.
*
* @param[in] dev device descriptor of sensor
*
* @return 0 on success
* @return -1 on error
*/
int hdc1000_startmeasure(hdc1000_t *dev);
/**
* @brief Read sensor's data.
*
* @param[in] dev device descriptor of sensor
* @param[out] rawtemp raw temperature value
* @param[out] rawhum raw humidity value
*
* @return 0 on success
* @return -1 on error
*/
int hdc1000_read(hdc1000_t *dev, uint16_t *rawtemp, uint16_t *rawhum);
/**
* @brief Convert raw sensor values to temperature and humidity.
*
* @param[in] rawtemp raw temperature value
* @param[in] rawhum raw humidity value
* @param[out] temp converted temperature*100
* @param[out] hum converted humidity*100
*/
void hdc1000_convert(uint16_t rawtemp, uint16_t rawhum, int *temp, int *hum);
#ifdef __cplusplus
}
#endif
#endif
/** @} */

View File

@ -18,7 +18,7 @@ Finally, in order for the shell to receive input, the `uart0` module
is used.
usage
Usage
=====
Build, flash and start the application:
@ -35,8 +35,8 @@ that is `/dev/ttyUSB0`. If your port is named differently, the
`PORT=/dev/yourport` variable can be used to override this.
Example
=======
Example output
==============
The shell commands come with online help. Call `help` to see which commands
exist and what they do.

6
pkg/libcoap/.gitattributes vendored Normal file
View File

@ -0,0 +1,6 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
0001-Add-RIOT-Makefile.patch binary
0002-Add-config.h.patch binary
0003-Remove-two-example-programs-in-root.patch binary
0004-Eliminate-some-compiler-warnings-and-errors.patch binary
0005-fix-old-style-function-declarations.patch binary

3
pkg/micro-ecc/.gitattributes vendored Normal file
View File

@ -0,0 +1,3 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
0001-Add-RIOT-Makefile.patch binary
0002-Include-RIOT-Hardware-RNG-interface.patch binary

4
pkg/microcoap/.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
0001-Remove-unneeded-.c-files.patch binary
0002-Add-RIOT-Makefile.patch binary
0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch binary

5
pkg/oonf_api/.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
0001-add-RIOT-support.patch binary
0002-port-tests-to-riot.patch binary
0003-port-example-to-riot.patch binary
0004-fix-conflicting-types.patch binary

6
pkg/openwsn/.gitattributes vendored Normal file
View File

@ -0,0 +1,6 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
0001-Add-RIOT-Makefiles.patch binary
0002-Add-RIOT-adaption.patch binary
0003-Fix-old-style-definitions.patch binary
0004-provide-openserial-dummies.patch binary
0005-fixes-to-RIOT-adaption.patch binary

2
pkg/tlsf/.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Ignore whitespace errors inside these patch files by regarding them as binary.
patch.txt binary

View File

@ -86,7 +86,7 @@ extern "C" {
* Extension Header */
#define NG_PROTNUM_IPV6_EXT_AH (51) /**< IPv6 Authentication Extension
* Header */
#define NG_PROTNUM_I_NLSP (52) /**< Integrated Net Layer Security
#define NG_PROTNUM_I_NLSP (52) /**< Integrated Net Layer Security
* TUBA */
#define NG_PROTNUM_SWIPE (53) /**< IP with Encryption (deprecated) */
#define NG_PROTNUM_NARP (54) /**< NBMA Address Resolution Protocol */

View File

@ -119,7 +119,7 @@ void l2_ping_init(void);
* @param[in] interval the interval between sending ping requests,
* if 0 the default interval (#L2_PING_DEFAULT_INTERVAL)
* @param[in] payload optional payload data, may be NULL
* @param[in] payload_len the length of the payload data, must be smaller than
* @param[in] payload_len the length of the payload data, must be smaller than
* #L2_PING_PAYLOAD_SIZE
* @param[in] probe_only do not request a pong response
*/

View File

@ -8,7 +8,7 @@
/**
* @defgroup socket_base Transport layer implementation
*
*
* @ingroup net
* @brief This module implements basic transport layer socket functionality.
* This includes 6LoWPAN UDP header compression and (experimental)

View File

@ -1 +1 @@
include $(RIOTBASE)/Makefile.base
include $(RIOTBASE)/Makefile.base

View File

@ -10,7 +10,7 @@
* @ingroup socket_base
* @{
* @file socket.c
* @brief functions for BSD socket API, methods return default values and
* @brief functions for BSD socket API, methods return default values and
* will be overwritten by appropriate transport layer protocols.
* @author Oliver Gesch <oliver.gesch@googlemail.com>
* @author Cenk Gündoğan <cnkgndgn@gmail.com>

View File

@ -1,86 +1,101 @@
# Test for nrf24l01p lowlevel functions
# Test for nrf24l01p lowlevel functions
## About
This is a small test application to see how the lowlevel-driver functions of the proprietary nrf24l01p-transceiver work. These functions consist of general SPI and GPIO commands, which abstract the driver-functions from the used board.
This is a small test application to see how the lowlevel-driver functions of
the proprietary nrf24l01p-transceiver work. These functions consist of general
SPI and GPIO commands, which abstract the driver-functions from the used board.
## Predefined pin mapping
Please compare the `tests/driver_nrf24l01p_lowlevel/Makefile` for predefined pin-mappings on different boards. (In addition, you also need to connect to 3V and GND)
Please compare the `tests/driver_nrf24l01p_lowlevel/Makefile` for predefined
pin-mappings on different boards. (In addition, you also need to connect to 3V
and GND)
## Usage
You should be presented with the RIOT shell, providing you with commands to initialize the transceiver (command: `it`), sending one packet (command: `send`) or read out and print all registers of the transceiver as binary values (command: `prgs`).
You should be presented with the RIOT shell, providing you with commands to
initialize the transceiver (command: `it`), sending one packet (command:
`send`) or read out and print all registers of the transceiver as binary values
(command: `prgs`).
### Procedure
* take two boards and connect a transceiver to each
(it should be also possible to use one board with different SPI-ports)
* depending on your board, you'll maybe also need to connect a UART/tty converter
* build and flash the test-program to each
* open a terminal (e.g. pyterm) for each
* if possible, reset the board by using the reset-button. You'll see "_Welcome to RIOT_" etc.
* type `help` to see the description of the commands
* initialize both with `it`
* with one board, send a packet by typing `send`
* in the next step you can also use `send` to send data in the other direction
* now you can use send on both boards/transceivers to send messages between them
* take two boards and connect a transceiver to each
(it should be also possible to use one board with different SPI-ports)
* depending on your board, you'll maybe also need to connect a UART/tty converter
* build and flash the test-program to each
* open a terminal (e.g. pyterm) for each
* if possible, reset the board by using the reset-button. You'll see "_Welcome to RIOT_" etc.
* type `help` to see the description of the commands
* initialize both with `it`
* with one board, send a packet by typing `send`
* in the next step you can also use `send` to send data in the other direction
* now you can use send on both boards/transceivers to send messages between them
## Expected Results
After you did all steps described above, you should see that a 32 Byte sequence (numbers from 32...1) has been transferred from one device to the other. This sequence is printed out from the receiver after the receive interrupt occurred and the receive-procedure has been made.
After you did all steps described above, you should see that a 32 Byte sequence
(numbers from 32...1) has been transferred from one device to the other. This
sequence is printed out from the receiver after the receive interrupt occurred
and the receive-procedure has been made.
After initialization (`it`) you should see the following output:
```
> it
Init Transceiver
Registering nrf24l01p_rx_handler thread...
################## Print Registers ###################
REG_CONFIG:
REG_CONFIG:
0x0 returned: 00111111
REG_EN_AA:
REG_EN_AA:
0x1 returned: 00000001
REG_EN_RXADDR:
REG_EN_RXADDR:
0x2 returned: 00000011
REG_SETUP_AW:
REG_SETUP_AW:
0x3 returned: 00000011
REG_SETUP_RETR:
REG_SETUP_RETR:
0x4 returned: 00101111
REG_RF_CH:
REG_RF_CH:
0x5 returned: 00000101
REG_RF_SETUP:
REG_RF_SETUP:
0x6 returned: 00100111
REG_STATUS:
REG_STATUS:
0x7 returned: 00001110
REG_OBSERVE_TX:
REG_OBSERVE_TX:
0x8 returned: 00000000
REG_RPD:
REG_RPD:
0x9 returned: 00000000
REG_RX_ADDR_P0:
0xa returned: e7 e7 e7 e7 e7
REG_RX_ADDR_P0:
0xa returned: e7 e7 e7 e7 e7
REG_TX_ADDR:
0x10 returned: e7 e7 e7 e7 e7
REG_TX_ADDR:
0x10 returned: e7 e7 e7 e7 e7
REG_RX_PW_P0:
REG_RX_PW_P0:
0x11 returned: 00100000
REG_FIFO_STATUS:
REG_FIFO_STATUS:
0x17 returned: 00010001
REG_DYNPD:
REG_DYNPD:
0x1c returned: 00000000
REG_FEATURE:
REG_FEATURE:
0x1d returned: 00000000
```
@ -89,6 +104,6 @@ After the data has been sent (`send`), you should see the following output on th
```
In HW cb
nrf24l01p_rx_handler got a message: Received packet.
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
```
```

View File

@ -29,4 +29,3 @@ while hwtimers > 1:
# term.expect("OK")
if not term.terminate():
term.terminate(force=True)

View File

@ -1,11 +1,16 @@
About
=====
This is a test application for a digital to analog converter (DAC).
This test application will initialize each configured DAC and one ADC (ADC_O) device to sample with
10-bit accuracy. The ADC is only initialized if there is one available on your board.
This test application will initialize each configured DAC and one ADC (ADC_O)
device to sample with 10-bit accuracy. The ADC is only initialized if there is
one available on your board.
After initialization, values from 0 to 1000 are converted through the DACs in a loop. Shortly after the digital to analog conversion of one number, the ADC_0 samples its input signal. The numbers that are given to the DACs and the numbers that are sampled by the ADC were printed to the STDOUT.
After initialization, values from 0 to 1000 are converted through the DACs in a
loop. Shortly after the digital to analog conversion of one number, the ADC_0
samples its input signal. The numbers that are given to the DACs and the
numbers that are sampled by the ADC were printed to the STDOUT.
Usage
=====

View File

@ -56,4 +56,3 @@ int main(void) {
puts("main: finished");
return 0;
}

View File

@ -72,4 +72,3 @@ int main(void) {
puts("Done.");
return 0;
}

View File

@ -75,4 +75,3 @@ int main(void)
puts("finished");
return 0;
}

View File

@ -101,4 +101,3 @@ int main(void)
puts("finished");
return 0;
}

View File

@ -1,2 +1 @@
include $(RIOTBASE)/Makefile.base