Skip to content
Snippets Groups Projects
Commit 6380c0d9 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a new macro for the actual number of motion pages.

parent 437588fc
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ SCHEDULER_PATH = ../scheduler ...@@ -19,7 +19,7 @@ SCHEDULER_PATH = ../scheduler
INCLUDE_DIRS = -I./include/ -I./include/modules -I$(COMM_PATH)/include -I$(UTILS_PATH)/include -I$(DYN_BASE_PATH)/include -I$(MEMORY_PATH)/include -I$(SCHEDULER_PATH)/include INCLUDE_DIRS = -I./include/ -I./include/modules -I$(COMM_PATH)/include -I$(UTILS_PATH)/include -I$(DYN_BASE_PATH)/include -I$(MEMORY_PATH)/include -I$(SCHEDULER_PATH)/include
MACROS = -DMAX_DYN_MASTER_TX_BUFFER_LEN=256 -DMAX_DYN_MASTER_RX_BUFFER_LEN=256 -DDYN_MANAGER_MAX_NUM_MASTERS=4 -DDYN_MANAGER_MAX_NUM_MODULES=8 -DDYN_MANAGER_MAX_NUM_DEVICES=32 -DDYN_MANAGER_MAX_NUM_SINGLE_OP=16 -DDYN_MANAGER_MAX_NUM_SYNC_OP=4 -DDYN_MANAGER_MAX_NUM_BULK_OP=4 -DMODULE_MAX_NUM_MODELS=32 -DMM_MAX_NUM_MOTION_MODULES=8 MACROS = -DMAX_DYN_MASTER_TX_BUFFER_LEN=256 -DMAX_DYN_MASTER_RX_BUFFER_LEN=256 -DDYN_MANAGER_MAX_NUM_MASTERS=4 -DDYN_MANAGER_MAX_NUM_MODULES=8 -DDYN_MANAGER_MAX_NUM_DEVICES=32 -DDYN_MANAGER_MAX_NUM_SINGLE_OP=16 -DDYN_MANAGER_MAX_NUM_SYNC_OP=4 -DDYN_MANAGER_MAX_NUM_BULK_OP=4 -DMODULE_MAX_NUM_MODELS=32 -DMM_MAX_NUM_MOTION_MODULES=8 -DNUM_MOTION_PAGES=256
TCHAIN_PREFIX=arm-none-eabi- TCHAIN_PREFIX=arm-none-eabi-
......
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
extern "C" { extern "C" {
#endif #endif
#define MAX_PAGES 256 #ifndef NUM_MOTION_PAGES
#error "Please, specify the number of motion pages with the NUM_MOTION_PAGES macro"
#endif
#define MAX_MOTION_PAGES 256
#define PAGE_MAX_NUM_SERVOS 31 #define PAGE_MAX_NUM_SERVOS 31
#define POSE_NUMBER_OF_POSES_PER_PAGE 7 #define POSE_NUMBER_OF_POSES_PER_PAGE 7
...@@ -42,7 +46,7 @@ typedef struct // Page Structure (total 512unsigned char) ...@@ -42,7 +46,7 @@ typedef struct // Page Structure (total 512unsigned char)
TStep steps[POSE_NUMBER_OF_POSES_PER_PAGE]; // Page step 65~511 TStep steps[POSE_NUMBER_OF_POSES_PER_PAGE]; // Page step 65~511
}TPage; }TPage;
extern TPage motion_pages[MAX_PAGES]; extern TPage motion_pages[NUM_MOTION_PAGES];
// public functions // public functions
void pages_get_page(unsigned char page_id,TPage *page); void pages_get_page(unsigned char page_id,TPage *page);
......
...@@ -42,4 +42,4 @@ inline unsigned char pages_get_slope(TPage *page,unsigned char servo_id) ...@@ -42,4 +42,4 @@ inline unsigned char pages_get_slope(TPage *page,unsigned char servo_id)
return 0x01<<(page->header.slope[servo_id]&0x0F); return 0x01<<(page->header.slope[servo_id]&0x0F);
} }
TPage motion_pages[MAX_PAGES] __attribute__ ((section (".pages"))) __attribute__((weak)); TPage motion_pages[NUM_MOTION_PAGES] __attribute__ ((section (".pages"))) __attribute__((weak));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment