else
lcd_clear();
#endif
+ if (ret != CMD_RET_SUCCESS)
+ thor_status_notify(THOR_NOTIFY_DOWNLOAD_FAILED, NULL);
#endif
bad_args:
if (argc == 1) {
return ret;
}
+__weak void thor_status_notify(enum thor_notify_type type,
+ struct thor_notify_data *data)
+{
+}
+
U_BOOT_CMD(thordown, CONFIG_SYS_MAXARGS, 1, do_thor_down,
"TIZEN \"THOR\" downloader",
"<USB_controller> <interface> <dev>\n"
{
struct thor_dev *dev = thor_func->dev;
size_t data_to_rx, tmp;
+#ifdef CONFIG_TIZEN
+ struct thor_notify_data nd;
+#endif
int status;
data_to_rx = dev->out_req->length;
data_to_rx -= dev->out_req->actual;
#ifdef CONFIG_TIZEN
downloaded_file_size += dev->out_req->actual;
+
+ nd.total_size = total_file_size;
+ nd.current_size = downloaded_file_size;
+ thor_status_notify(THOR_NOTIFY_PROGRESS, &nd);
+
#ifdef CONFIG_LCD /* TODO : Need to enable LCD*/
draw_thor_progress(total_file_size, downloaded_file_size);
#endif
int power_key_cnt = 0;
int ret;
+ thor_status_notify(THOR_NOTIFY_INIT, NULL);
+
#ifdef CONFIG_TIZEN
#ifdef CONFIG_LCD /* TODO : Need to enable LCD*/
draw_thor_init_screen();
draw_thor_connected();
#endif
#endif
+ thor_status_notify(THOR_NOTIFY_CONNECTED, NULL);
+
thor_set_dma(thor_rx_data_buf, strlen("THOR"));
/* detect the download request from Host PC */
ret = thor_rx_data(udc);
int thor_handle(struct udevice *udc);
int thor_init(struct udevice *udc);
int thor_add(struct usb_configuration *c);
+
+enum thor_notify_type {
+ THOR_NOTIFY_INIT,
+ THOR_NOTIFY_CONNECTED,
+ THOR_NOTIFY_PROGRESS,
+ THOR_NOTIFY_DOWNLOAD_FAILED,
+};
+
+struct thor_notify_data {
+ u64 total_size;
+ u64 current_size;
+};
+
+void thor_status_notify(enum thor_notify_type type,
+ struct thor_notify_data *data);
#endif /* __THOR_H_ */