Exemple #1
0
uint16_t adcGet(uint8_t channel)
{
	uint16_t _t;
	ATOMIC_BLOCK(ATOMIC_FORCEON)
		_t = _adc[channel];
	return _t;
}
void processNetworkPackets(void)
{
	Packet_t *packet;
	ATOMIC_BLOCK(ATOMIC_FORCEON)
		packet = Packet_GetInput();
	if(packet) {
// TODO: if there is one packet, there could be more packets
		sleep_disable();
		ATOMIC_BLOCK(ATOMIC_FORCEON) {
			Packet_ReattachOutput(packet);
			USB_EnableTransmitter();
		}
	}
}