diff --git a/include/time.h b/include/stm32_time.h similarity index 77% rename from include/time.h rename to include/stm32_time.h index 365b6663a0dfa279d807047263be25cb3e37f0c0..9595becd1e7e53acb500b90f339f20ca7a378a53 100755 --- a/include/time.h +++ b/include/stm32_time.h @@ -1,5 +1,5 @@ -#ifndef _TIME_H -#define _TIME_H +#ifndef _STM32_TIME_H +#define _STM32_TIME_H #include "stm32f4xx.h" #include "system_stm32f4xx.h" diff --git a/src/action.c b/src/action.c index ee7f1e4dcdb00d3901a4808e7fc79b31a2b2f6f1..365f41e0a04601f9f0f038170b5ffe977b8af0b8 100644 --- a/src/action.c +++ b/src/action.c @@ -423,7 +423,6 @@ void action_process(void) { if(action_end) { - action_load_next_step(); state=ACTION_PAUSE; action_end=0x00; ram_clear_bit(BIOLOID_ACTION_STATUS,0); diff --git a/src/bioloid_stm32.c b/src/bioloid_stm32.c index 81b5f694ee79e66cfa1109e5e7373f0e4551ed13..950f0871aca7020bf086d4028314096b9b16763a 100644 --- a/src/bioloid_stm32.c +++ b/src/bioloid_stm32.c @@ -1,7 +1,7 @@ #include "stm32f4xx.h" #include "system_stm32f4xx.h" -#include "time.h" +#include "stm32_time.h" #include "dynamixel.h" #include "dynamixel_master_uart_dma.h" #include "dynamixel_slave_uart_dma.h" @@ -17,9 +17,7 @@ int32_t main(void) { - uint16_t eeprom_data,i,num_errors=0; - uint16_t action_period,mm_period; - TPage page; + uint16_t eeprom_data,action_period,mm_period; /* initialize EEPROM */ EE_Init(); @@ -30,8 +28,8 @@ int32_t main(void) /* initialize the gpio */ gpio_init(); /* initialize the dynamixel master interface */ -// dyn_master_init(); -// dyn_master_set_timeout(20); + dyn_master_init(); + dyn_master_set_timeout(20); /* initialize the dynamixel slave interface*/ dyn_slave_init(); EE_ReadVariable(DEVICE_ID_OFFSET,&eeprom_data); @@ -54,20 +52,10 @@ int32_t main(void) // initialize the action module // action_init(action_period); comm_init(); - comm_start(); gpio_blink_led(NORTH_LED,1000); - for(i=0;i<256;i++) - { - pages_get_page(i,&page); - if(!pages_check_checksum(&page)) - num_errors++; - } - if(num_errors==0) - gpio_set_led(SOUTH_LED); - while(1); } diff --git a/src/dynamixel_master_uart_dma.c b/src/dynamixel_master_uart_dma.c index b1f98b08cc97c2b94b5d33894f3aa50ee1ce51f4..a5b515e0225544235f3ea87265bcada689bbfc85 100755 --- a/src/dynamixel_master_uart_dma.c +++ b/src/dynamixel_master_uart_dma.c @@ -1,6 +1,6 @@ #include "dynamixel_master_uart_dma.h" #include "motion_manager.h" -#include "time.h" +#include "stm32_time.h" #define USART USART2 #define USART_CLK RCC_APB1Periph_USART2 diff --git a/src/motion_manager.c b/src/motion_manager.c index 0650f7bc74c50fbc4f2cc1fc940423a5387759f0..703a7c81dd905b7fdbb6472a91c058efae3ed82f 100644 --- a/src/motion_manager.c +++ b/src/motion_manager.c @@ -4,7 +4,7 @@ #include "gpio.h" #include "ram.h" #include "action.h" -#include "time.h" +#include "stm32_time.h" #define MOTION_TIMER TIM3 #define MOTION_TIMER_IRQn TIM3_IRQn diff --git a/src/motion_pages.c b/src/motion_pages.c index afc0e0e762018842707cc128afc2407874ee1860..147398dc9cf9164c40da4c0299da2c423a9bf616 100644 --- a/src/motion_pages.c +++ b/src/motion_pages.c @@ -5,7 +5,7 @@ void pages_get_page(uint8_t page_id,TPage *page) uint16_t i=0; for(i=0;i<sizeof(TPage);i++) - ((uint8_t *)page)[i]=((__IO uint8_t *)&motion_pages[page_id])[i]; + ((uint8_t *)page)[i]=((uint8_t *)&motion_pages[page_id])[i]; } uint8_t pages_check_checksum(TPage *page) diff --git a/src/time.c b/src/stm32_time.c similarity index 98% rename from src/time.c rename to src/stm32_time.c index 44dd1b79c4c7c99b968312e1dfbc1bcbe9ab6bc6..f2f8044ae17fb7cd4803453dfc07431fdd5c568c 100644 --- a/src/time.c +++ b/src/stm32_time.c @@ -1,4 +1,4 @@ -#include "time.h" +#include "stm32_time.h" static __IO uint32_t timing_delay; uint32_t clocks_per_us;