1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

avsextrem: some cleanup

This commit is contained in:
Oleg Hahm 2015-11-28 14:13:19 +01:00
parent 8243a153be
commit 875f48979a
4 changed files with 11 additions and 17 deletions

View File

@ -97,11 +97,6 @@ float SMB380_getSampleRatio(void)
100000);
}
uint8_t smb380emptyfunction(int16_t *value)
{
return 1;
}
uint8_t SMB380_HystereseFunctionSample(int16_t *value)
{
static int16_t x = 0, y = 0, z = 0;
@ -192,7 +187,7 @@ uint8_t SMB380_init(uint8_t (*func)(int16_t *))
#if SMB380_EXTINT_MODE
if (gpioint_set(0, BIT1, GPIOINT_RISING_EDGE, &SMB380_extIntHandler));
gpioint_set(0, BIT1, GPIOINT_RISING_EDGE, &SMB380_extIntHandler);
#endif
@ -202,11 +197,9 @@ uint8_t SMB380_init(uint8_t (*func)(int16_t *))
smb380function = func;
}
else {
smb380function = smb380emptyfunction;
smb380function = NULL;
}
//smb380function = SMB380_HystereseFunctionSample; //placeholder
SMB380_softReset();
xtimer_usleep(100000);
SMB380_disableUpperLimit();
@ -426,10 +419,9 @@ uint8_t writeRingBuff(int16_t *value)
smb380function = smb380emptyfunction;
}
smb380function(value);
//printf("Werte: x=%i, y=%i, z=%i\n\r",value[0], value[1], value[2]);
//vgpio_toggle(&gpio_led_green);
if (smb380function != NULL) {
smb380function(value);
}
settings.writePointerPos += 1;

View File

@ -27,6 +27,7 @@ void lpm_arch_init(void)
enum lpm_mode lpm_arch_set(enum lpm_mode target)
{
(void) target;
/* TODO */
return 0;
}

View File

@ -380,6 +380,7 @@ void timer_start(tim_t dev)
void timer_irq_enable(tim_t dev)
{
(void) dev;
#ifdef DEVELHELP
printf("timer_irq_enable not implemented\n");
#endif

View File

@ -147,7 +147,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
switch (uart) {
#if UART_0_EN
case UART_0:
for (int i = 0; i < len; i++) {
for (unsigned i = 0; i < len; i++) {
while (!UART0_DTREG_EMPTY);
UART0_DATA_REGISTER = data[i];
}
@ -155,7 +155,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
#endif /* UART_0_EN */
#if UART_1_EN
case UART_1:
for (int i = 0; i < len; i++) {
for (unsigned i = 0; i < len; i++) {
while (!UART1_DTREG_EMPTY);
UART1_DATA_REGISTER = data[i];
}
@ -163,7 +163,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
#endif /* UART_1_EN */
#if UART_2_EN
case UART_2:
for (int i = 0; i < len; i++) {
for (unsigned i = 0; i < len; i++) {
while (!UART2_DTREG_EMPTY);
UART2_DATA_REGISTER = data[i];
}
@ -171,7 +171,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
#endif /* UART_2_EN */
#if UART_3_EN
case UART_3:
for (int i = 0; i < len; i++) {
for (unsigned i = 0; i < len; i++) {
while (!UART3_DTREG_EMPTY);
UART3_DATA_REGISTER = data[i];
}