I'm not listening to AI, I've seen the bullshit it suggested for code comments.
the pointers are variables in the class I am instantiating, so I would assume that these exist at the point I say, I want an object of this class, then the constructor would be called and I am trying to assign addresses to these pointers of existing objects. but apparently simple pointer variables that are part of the class definition are not available, so now who is trying to mix the ingredients after the cake is in the oven?
This is the class, the contention is now over " encoder_class * encoder[2]" is this not the correct way to setup an array of pointers to class type objects? or have I accidentally created 2 class instances ?
class io_board_1_class {
public:
can_open_class* bus;
uint32_t node_id;
uint16_t short_press;
uint16_t long_press;
volatile encoder_command_type encoder_command[2];
encoder_class * encoder[2];
node_status_type node_status;
uint32_t save_parameters = 0x65766173;
uint32_t restore_parameters = 0x64616F6C;
uint32_t producer_heartbeat_time = 500; // Heart beat in ms
od_type object[COMMS_OD_SIZE + 10u] = // index number must be the amount of entries as the array sizeof() is used to calculate the number of object entries
{
&node_status, STRUCTURE, 0x00, 0x0060, 0x0,
// RPDO stuff
&node_status.pdo[0].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1400, RO,
&node_status.pdo[0].cob_id, UNSIGNED32, 0x01, 0x1400, RW,
&node_status.pdo[0].transmission_type, UNSIGNED8, 0x02, 0x1400, RW,
&node_status.pdo[0].inhibit_time, UNSIGNED16, 0x03, 0x1400, RW,
&node_status.pdo[0].event_timer, UNSIGNED16, 0x05, 0x1400, RW,
&node_status.pdo[0].start_sync, UNSIGNED8, 0x06, 0x1400, RW,
&node_status.pdo[1].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1401, RO,
&node_status.pdo[1].cob_id, UNSIGNED32, 0x01, 0x1401, RW,
&node_status.pdo[1].transmission_type, UNSIGNED8, 0x02, 0x1401, RW,
&node_status.pdo[1].inhibit_time, UNSIGNED16, 0x03, 0x1401, RW,
&node_status.pdo[1].event_timer, UNSIGNED16, 0x05, 0x1401, RW,
&node_status.pdo[1].start_sync, UNSIGNED8, 0x06, 0x1401, RW,
&node_status.pdo[2].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1402, RO,
&node_status.pdo[2].cob_id, UNSIGNED32, 0x01, 0x1402, RW,
&node_status.pdo[2].transmission_type, UNSIGNED8, 0x02, 0x1402, RW,
&node_status.pdo[2].inhibit_time, UNSIGNED16, 0x03, 0x1402, RW,
&node_status.pdo[2].event_timer, UNSIGNED16, 0x05, 0x1402, RW,
&node_status.pdo[2].start_sync, UNSIGNED8, 0x06, 0x1402, RW,
&node_status.pdo[3].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1403, RO,
&node_status.pdo[3].cob_id, UNSIGNED32, 0x01, 0x1403, RW,
&node_status.pdo[3].transmission_type, UNSIGNED8, 0x02, 0x1403, RW,
&node_status.pdo[3].inhibit_time, UNSIGNED16, 0x03, 0x1403, RW,
&node_status.pdo[3].event_timer, UNSIGNED16, 0x05, 0x1403, RW,
&node_status.pdo[3].start_sync, UNSIGNED8, 0x06, 0x1403, RW,
&node_status.pdo[0].mapped_objects_n, UNSIGNED8, 0x00, 0x1600, RW,
&node_status.pdo[0].map[0], UNSIGNED32, 0x01, 0x1600, RW,
&node_status.pdo[0].map[1], UNSIGNED32, 0x02, 0x1600, RW,
&node_status.pdo[0].map[2], UNSIGNED32, 0x03, 0x1600, RW,
&node_status.pdo[0].map[3], UNSIGNED32, 0x04, 0x1600, RW,
&node_status.pdo[1].mapped_objects_n, UNSIGNED8, 0x00, 0x1601, RW,
&node_status.pdo[1].map[0], UNSIGNED32, 0x01, 0x1601, RW,
&node_status.pdo[1].map[1], UNSIGNED32, 0x02, 0x1601, RW,
&node_status.pdo[1].map[2], UNSIGNED32, 0x03, 0x1601, RW,
&node_status.pdo[1].map[3], UNSIGNED32, 0x04, 0x1601, RW,
&node_status.pdo[2].mapped_objects_n, UNSIGNED8, 0x00, 0x1602, RW,
&node_status.pdo[2].map[0], UNSIGNED32, 0x01, 0x1602, RW,
&node_status.pdo[2].map[1], UNSIGNED32, 0x02, 0x1602, RW,
&node_status.pdo[2].map[2], UNSIGNED32, 0x03, 0x1602, RW,
&node_status.pdo[2].map[3], UNSIGNED32, 0x04, 0x1602, RW,
&node_status.pdo[3].mapped_objects_n, UNSIGNED8, 0x00, 0x1603, RW,
&node_status.pdo[3].map[0], UNSIGNED32, 0x01, 0x1603, RW,
&node_status.pdo[3].map[1], UNSIGNED32, 0x02, 0x1603, RW,
&node_status.pdo[3].map[2], UNSIGNED32, 0x03, 0x1603, RW,
&node_status.pdo[3].map[3], UNSIGNED32, 0x04, 0x1603, RW,
// TPDO stuff
&node_status.pdo[4].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1800, RW,
&node_status.pdo[4].cob_id, UNSIGNED32, 0x01, 0x1800, RW,
&node_status.pdo[4].transmission_type, UNSIGNED8, 0x02, 0x1800, RW,
&node_status.pdo[4].inhibit_time, UNSIGNED16, 0x03, 0x1800, RW,
&node_status.pdo[4].event_timer, UNSIGNED16, 0x05, 0x1800, RW,
&node_status.pdo[4].start_sync, UNSIGNED8, 0x06, 0x1800, RW,
&node_status.pdo[5].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1801, RW,
&node_status.pdo[5].cob_id, UNSIGNED32, 0x01, 0x1801, RW,
&node_status.pdo[5].transmission_type, UNSIGNED8, 0x02, 0x1801, RW,
&node_status.pdo[5].inhibit_time, UNSIGNED16, 0x03, 0x1801, RW,
&node_status.pdo[5].event_timer, UNSIGNED16, 0x05, 0x1801, RW,
&node_status.pdo[5].start_sync, UNSIGNED8, 0x06, 0x1800, RW,
&node_status.pdo[6].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1802, RW,
&node_status.pdo[6].cob_id, UNSIGNED32, 0x01, 0x1802, RW,
&node_status.pdo[6].transmission_type, UNSIGNED8, 0x02, 0x1802, RW,
&node_status.pdo[6].inhibit_time, UNSIGNED16, 0x03, 0x1802, RW,
&node_status.pdo[6].event_timer, UNSIGNED16, 0x05, 0x1802, RW,
&node_status.pdo[6].start_sync, UNSIGNED8, 0x06, 0x1800, RW,
&node_status.pdo[7].highest_sub_index_supported, UNSIGNED8, 0x00, 0x1803, RW,
&node_status.pdo[7].cob_id, UNSIGNED32, 0x01, 0x1803, RW,
&node_status.pdo[7].transmission_type, UNSIGNED8, 0x02, 0x1803, RW,
&node_status.pdo[7].inhibit_time, UNSIGNED16, 0x03, 0x1803, RW,
&node_status.pdo[7].event_timer, UNSIGNED16, 0x05, 0x1803, RW,
&node_status.pdo[7].start_sync, UNSIGNED8, 0x06, 0x1803, RW,
&node_status.pdo[4].mapped_objects_n, UNSIGNED8, 0x00, 0x1A00, RW,
&node_status.pdo[4].map[0], UNSIGNED32, 0x01, 0x1A00, RW,
&node_status.pdo[4].map[1], UNSIGNED32, 0x02, 0x1A00, RW,
&node_status.pdo[4].map[2], UNSIGNED32, 0x03, 0x1A00, RW,
&node_status.pdo[4].map[3], UNSIGNED32, 0x04, 0x1A00, RW,
&node_status.pdo[5].mapped_objects_n, UNSIGNED8, 0x00, 0x1A01, RW,
&node_status.pdo[5].map[0], UNSIGNED32, 0x01, 0x1A01, RW,
&node_status.pdo[5].map[1], UNSIGNED32, 0x02, 0x1A01, RW,
&node_status.pdo[5].map[2], UNSIGNED32, 0x03, 0x1A01, RW,
&node_status.pdo[5].map[3], UNSIGNED32, 0x04, 0x1A01, RW,
&node_status.pdo[6].mapped_objects_n, UNSIGNED8, 0x00, 0x1A02, RW,
&node_status.pdo[6].map[0], UNSIGNED32, 0x01, 0x1A02, RW,
&node_status.pdo[6].map[1], UNSIGNED32, 0x02, 0x1A02, RW,
&node_status.pdo[6].map[2], UNSIGNED32, 0x03, 0x1A02, RW,
&node_status.pdo[6].map[3], UNSIGNED32, 0x04, 0x1A02, RW,
&node_status.pdo[7].mapped_objects_n, UNSIGNED8, 0x00, 0x1A03, RW,
&node_status.pdo[7].map[0], UNSIGNED32, 0x01, 0x1A03, RW,
&node_status.pdo[7].map[1], UNSIGNED32, 0x02, 0x1A03, RW,
&node_status.pdo[7].map[2], UNSIGNED32, 0x03, 0x1A03, RW,
&node_status.pdo[7].map[3], UNSIGNED32, 0x04, 0x1A03, RW,
&save_parameters, UNSIGNED32, 0x01, 0x1010, 0x0,
&restore_parameters, UNSIGNED32, 0x01, 0x1011, 0x0,
&producer_heartbeat_time, UNSIGNED16, 0x00, 0x1017, 0x0,
// End coms section
&encoder[0]->counts, INTEGER32, 0x01, 0x2000, RW,
&encoder[0]->high_limit, INTEGER32, 0x02, 0x2000, RW,
&encoder[0]->low_limit, INTEGER32, 0x03, 0x2000, RW,
&encoder_command[0], UNSIGNED64, 0x04, 0x2000, RW,
&encoder[1]->counts, INTEGER32, 0x01, 0x2001, RW,
&encoder[1]->high_limit, INTEGER32, 0x02, 0x2001, RW,
&encoder[1]->low_limit, INTEGER32, 0x03, 0x2001, RW,
&encoder_command[1], UNSIGNED64, 0x04, 0x2001, RW,
&short_press, UNSIGNED16, 01, 0x2010, RW,
&long_press, UNSIGNED16, 02, 0x2010, RW,
};
io_board_1_class(device_type deviceType, can_open_class* new_bus, uint32_t new_node_n,
encoder_class * encoder0ptr, encoder_class* encoder1ptr );
void interrupt_routine(void) ;
void encoder_config_update(void) ;
void encoder_config(uint32_t n);
};