コード例 #1
0
ファイル: ti_icdi_usb.c プロジェクト: IoTToolchain/OpenOCD
static enum target_state icdi_usb_state(void *handle)
{
	int result;
	struct icdi_usb_handle_s *h = handle;
	uint32_t dhcsr;
	uint8_t buf[4];

	result = icdi_usb_read_mem(h, DCB_DHCSR, 4, 1, buf);
	if (result != ERROR_OK)
		return TARGET_UNKNOWN;

	/* REVISIT: There's no target pointer here so there's no way to use target_buffer_get_u32().
	 * I guess all supported chips are little-endian anyway. */
	dhcsr = le_to_h_u32(buf);
	if (dhcsr & S_HALT)
		return TARGET_HALTED;

	return TARGET_RUNNING;
}
コード例 #2
0
ファイル: ti_icdi_usb.c プロジェクト: SayCV/tools-OpenOCD
static int icdi_usb_read_mem32(void *handle, uint32_t addr, uint16_t len, uint8_t *buffer)
{
	return icdi_usb_read_mem(handle, addr, len * 4, buffer);
}