/* Add a value to the end of the plot. 
Scales the input value to fit the plot dimensions and adds it to the end of the ring buffer. */
bool wtk_plot_add_value(struct wtk_plot *plot, uint8_t value)
/* Add a value to the end of the plot. 
Scales the input value to fit the plot dimensions and adds it to the end of the ring buffer. */
bool wtk_plot_add_value(struct wtk_plot *plot, uint8_t value)
{
	uint8_t height;
	uint8_t maximum;
	struct win_area const *area;
	Assert(plot);
	Assert(value <= plot->maximum);
	Assert(plot->buffer_start < plot->num_datapoints);
	maximum = plot->maximum;
	area = win_get_area(plot->container);
	height = area->size.y - 2;
	*(plot->plot_buffer + plot->buffer_start)
		= height - wtk_rescale_value((value), maximum, height - 1);
	plot->buffer_start++;
	if (plot->buffer_start >= plot->num_datapoints) {
		plot->buffer_start = 0;
	}
	return true;
}