/* Write string to the print buffer. 
This is a helper function for copying a string into the print buffer, using circular buffer indexing. */
static void _dbg_write_str_to_buffer(const char *str, dbg_buffer_space_t length)
/* Write string to the print buffer. 
This is a helper function for copying a string into the print buffer, using circular buffer indexing. */
static void _dbg_write_str_to_buffer(const char *str, dbg_buffer_space_t length)
{
	Assert(str);
	while (length--) {
			dbg_buffer[buffer_head++] = (uint8_t)*(str++);
			buffer_head &= DBG_BUFFER_MASK;
	}
}