I've searched for quite some time and I've experimented with this and I don't seem to be getting anywhere.
Can I edit/modify/make changes to the core *.cpp and *.h files located in "...\Arduino\hardware\arduino\avr\cores\arduino" to make fundamental changes to how certain things work?
Logic tells me YES, of course you can, but experimentation shows no changes. I make changes to HardwareSerial.cpp, save the changes, reboot Arduino IDE, compile and upload my code but nothing. I've even rebooted the whole computer after making changes to a core file but I still see no changes.
Sorry for this question, i feel dumb asking it, but I have not found an answer explicitly stated anywhere that this is possible.
Can I edit/modify/make changes to the core *.cpp and *.h files located in "...\Arduino\hardware\arduino\avr\cores\arduino" to make fundamental changes to how certain things work?
Yes.
but I still see no changes.
What changes did you make? What did you expect to see happen differently? What did happen, instead?
So I want to make changes to HardwareSerial, which I know will be quite complicated. Prior to making any big changes, I just wanted to see how to make changes happen so I simply changed HardwareSerial::read(void) to return 10:
int HardwareSerial::read(void)
{
// if the head isn't ahead of the tail, we don't have any characters
if (_rx_buffer_head == _rx_buffer_tail) {
return -1;
} else {
unsigned char c = _rx_buffer[_rx_buffer_tail];
_rx_buffer_tail = (rx_buffer_index_t)(_rx_buffer_tail + 1) % SERIAL_RX_BUFFER_SIZE;
//return c;
return 10;
}
}
So I expect to have any Serial.read() to return an integer = 10.
Arduino Leonardo, which come to think of it is probably the issue and I need to read more core files.
To finish my thought:
So I expect to have any Serial.read() to return an integer = 10.
After making this change to the file, nothing appears to change during implementation.
Side note: I've thought about things over lunch and I think I'm just going to process the serial data as chars and convert to ints rather than trying to change any core files. If this method keeps my code running at the desired frequency then I'll be happy. If not, then I'll try to implement more efficient code.
Back to the original question, though, thanks for answering that I should see changes if I make changes to core files. Other than restarting the IDE, do I need to do anything else to see these changes take place?