Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
humanoides
bioloid_stm32_fw
Commits
c13794a9
Commit
c13794a9
authored
Apr 03, 2016
by
Sergi Hernandez
Browse files
Corrected some misspelling errors and missing headers.
parent
380e0132
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bioloid_dyn_slave.c
View file @
c13794a9
...
...
@@ -9,6 +9,7 @@
#include
"bioloid_gyro.h"
#include
"motion_manager.h"
#include
"action.h"
#include
"walking.h"
/* external interrupt pin */
#define DYN_SLAVE_EXT_INT_PIN GPIO_PIN_8
...
...
src/bioloid_gyro.c
View file @
c13794a9
#include
"bioloid_gyro.h"
#include
"bioloid_registers.h"
#include
"ram.h"
#define GYRO_MAX_CAL_SAMPLES 256
...
...
@@ -21,17 +22,17 @@ void gyro_init(void)
inline
adc_ch_t
gyro_get_fb_adc_channel
(
void
)
{
return
ram_data
[
BIOL
I
OD_GYRO_FB_ADC_CH
];
return
ram_data
[
BIOLO
I
D_GYRO_FB_ADC_CH
];
}
inline
adc_ch_t
gyro_get_lr_adc_channel
(
void
)
{
return
ram_data
[
BIOL
I
OD_GYRO_LR_ADC_CH
];
return
ram_data
[
BIOLO
I
D_GYRO_LR_ADC_CH
];
}
void
gyro_calibrate
(
void
)
{
adc_ch_t
fb_ch
=
ram_data
[
BIOL
I
OD_GYRO_FB_ADC_CH
],
lr_ch
=
ram_data
[
BIOL
I
OD_GYRO_LR_ADC_CH
];
adc_ch_t
fb_ch
=
ram_data
[
BIOLO
I
D_GYRO_FB_ADC_CH
],
lr_ch
=
ram_data
[
BIOLO
I
D_GYRO_LR_ADC_CH
];
uint16_t
i
;
gyro_fb_offset
=
0x0000
;
...
...
@@ -73,9 +74,9 @@ void gyro_process_read_cmd(unsigned short int address,unsigned short int length,
void
gyro_process_write_cmd
(
unsigned
short
int
address
,
unsigned
short
int
length
,
unsigned
char
*
data
)
{
// gyro channels
if
(
ram_in_range
(
BIOL
I
OD_GYRO_FB_ADC_CH
,
address
,
length
))
ram_data
[
BIOL
I
OD_GYRO_FB_ADC_CH
]
=
data
[
BIOL
I
OD_GYRO_FB_ADC_CH
-
address
];
if
(
ram_in_range
(
BIOL
I
OD_GYRO_LR_ADC_CH
,
address
,
length
))
ram_data
[
BIOL
I
OD_GYRO_LR_ADC_CH
]
=
data
[
BIOL
I
OD_GYRO_LR_ADC_CH
-
address
];
if
(
ram_in_range
(
BIOLO
I
D_GYRO_FB_ADC_CH
,
address
,
length
))
ram_data
[
BIOLO
I
D_GYRO_FB_ADC_CH
]
=
data
[
BIOLO
I
D_GYRO_FB_ADC_CH
-
address
];
if
(
ram_in_range
(
BIOLO
I
D_GYRO_LR_ADC_CH
,
address
,
length
))
ram_data
[
BIOLO
I
D_GYRO_LR_ADC_CH
]
=
data
[
BIOLO
I
D_GYRO_LR_ADC_CH
-
address
];
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment