Some of the structures, notably 'cmd', in the lib console stuff are a little too generically named and have collided with some other code so prefix the names a bit more cleanly with console_ The change is largely mechanical, and folks with out of tree code can easily switch by renaming: cmd -> console_cmd cmd_args -> console_cmd_args cmd_block -> console_cmd_block console_cmd -> console_cmd_func Apologies if this breaks you but it should be pretty easy to fix.
34 lines
764 B
C
34 lines
764 B
C
/*
|
|
* Copyright (c) 2008 Travis Geiselbrecht
|
|
*
|
|
* Use of this source code is governed by a MIT-style
|
|
* license that can be found in the LICENSE file or at
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
#include <app.h>
|
|
#include <lk/debug.h>
|
|
#include <stdio.h>
|
|
#include <dev/accelerometer.h>
|
|
#include <lk/compiler.h>
|
|
#include <lk/console_cmd.h>
|
|
|
|
void read_xyz(void);
|
|
|
|
STATIC_COMMAND_START
|
|
STATIC_COMMAND("read_xyz", "read xyz vectors", (console_cmd_func)&read_xyz)
|
|
STATIC_COMMAND_END(accelerometer);
|
|
|
|
void read_xyz(void) {
|
|
position_vector_t pos_vector;
|
|
acc_read_xyz(&pos_vector);
|
|
printf("X value = %f\n",pos_vector.x);
|
|
printf("Y value = %f\n",pos_vector.y);
|
|
printf("Z value = %f\n",pos_vector.z);
|
|
|
|
}
|
|
|
|
APP_START(accelerometer)
|
|
.flags = 0,
|
|
APP_END
|
|
|