Пример #1
0
void main(void)
{
#if 0
	size_t sz = CIRC_SPACE_SZ_FROM_HEAD_(7u, 1u, 8u);
	assert(sz == 1);

	static struct print_buf {
		/* size these to an appropriate atomic size */
		uint32_t head;
		uint32_t tail;
		uint8_t data[8];
	} print_buf;

	print_buf.head = 7;
	print_buf.tail = 1;

	sz = CIRC_SPACE_SZ_FROM_HEAD(print_buf);
	assert(sz == 1);
#endif
	__builtin_abort();

	for (;;) {
		delay_ms(100);
		debug_led_set(false);
		delay_ms(100);
		debug_led_set(true);
		print_str("012345678910\r\n");
	}
}
Пример #2
0
void em4x05_read(uint8_t addr) {
  debug_write("?BEGIN em4x05_read: 0x");
  debug_write_u16(addr, 16);
  debug_write_line("");

  debug_led_set(1);
  delay_ms(1);
  eeworkbench_begin_tx();
  delay_us(US_PER_RF_TICK * 5);

  _em4x05_tx_first_stop();
  _em4x05_tx(0);
  _em4x05_tx_command(COMMAND_READ);
  _em4x05_tx_addr(addr);

  debug_led_set(0);
  debug_write_line("?END em4x05_read");
}
Пример #3
0
void setup() {
  // Configure the NVIC Preemption Priority Bits
  // 2 bit for pre-emption priority, 2 bits for subpriority
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);

  debug_setup();
  debug_led_set(1);
  debug_write_line("?BEGIN setup");

  ring_buffer_u8_init(&g_usartInputRingBuffer, g_usartInputBuffer, INPUT_BUFFER_SIZE);

  ir_code_setup();
  time_setup();
  ir_tx_setup();
  ir_rx_setup();

  //cc3000_setup(0, 0);
  //wifi_connect();

  debug_led_set(0);
  debug_write_line("?END setup");
}