Example #1
0
// called when receiver DMA completes its transfer
extern "C" void irq_dma2_stream0() {
    ss(false);

    sample.num++;
    const uint8_t *pos = read_buf+1; // skip over the command byte
    for (int i=0; i<3; i++) // parse all values into sample structure
        sample.accel[i] = next16(pos);
    sample.temp = next16(pos);
    for (int i=0; i<3; i++)
        sample.gyro[i] = next16(pos);

    signal.notify_all(); // notify all tasks waiting
    DMA2->LIFCR = DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTCIF3 | DMA_LIFCR_CHTIF3; // clear status bits
    util_enable_irq(EXTI0_IRQn + PIN_INT); // enable INT interrupt
}
Example #2
0
 uint16_t absolute_y_pages() {
	uint16_t temp = next16();
	uint16_t res = temp + registers->y;
	if((temp & res) >> 8) {
		cycles++;
	}
	return res;
}
Example #3
0
 uint16_t indirect() {
	return fetch16(next16());
}
Example #4
0
 uint16_t absolute_y() {
	return next16() + registers->y;
}
Example #5
0
 uint16_t absolute_x() {
	return next16() + registers->x;
}
Example #6
0
 uint16_t absolute() {
	return next16();
}