1
0
Fork 0

Add example for CO_MULTIPLE_OD configuration.

This commit is contained in:
Janez 2021-06-29 11:16:50 +02:00
parent 598a2bb25f
commit bdcca85d07

View file

@ -83,7 +83,16 @@ int main (void){
/* Allocate memory */
CO = CO_new(NULL, &heapMemoryUsed);
CO_config_t *config_ptr = NULL;
#ifdef CO_MULTIPLE_OD
/* example usage of CO_MULTIPLE_OD (but still single OD here) */
CO_config_t co_config = {0};
OD_INIT_CONFIG(co_config); /* helper macro from OD.h */
co_config.CNT_LEDS = 1;
co_config.CNT_LSS_SLV = 1;
config_ptr = &co_config;
#endif /* CO_MULTIPLE_OD */
CO = CO_new(config_ptr, &heapMemoryUsed);
if (CO == NULL) {
log_printf("Error: Can't allocate memory\n");
return 0;