|
|
|
@ -118,6 +118,10 @@ static THD_FUNCTION(Thread1, arg)
|
|
|
|
(void)arg;
|
|
|
|
(void)arg;
|
|
|
|
chRegSetThreadName("sweep");
|
|
|
|
chRegSetThreadName("sweep");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __SD_CARD_LOAD__
|
|
|
|
|
|
|
|
sd_card_load_config("autoload.ini");
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TINYSA4
|
|
|
|
#ifndef TINYSA4
|
|
|
|
ui_process();
|
|
|
|
ui_process();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@ -241,10 +245,12 @@ toggle_sweep(void)
|
|
|
|
int shell_printf(const char *fmt, ...)
|
|
|
|
int shell_printf(const char *fmt, ...)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_list ap;
|
|
|
|
int formatted_bytes;
|
|
|
|
int formatted_bytes = 0;
|
|
|
|
va_start(ap, fmt);
|
|
|
|
if (shell_stream) {
|
|
|
|
formatted_bytes = chvprintf(shell_stream, fmt, ap);
|
|
|
|
va_start(ap, fmt);
|
|
|
|
va_end(ap);
|
|
|
|
formatted_bytes = chvprintf(shell_stream, fmt, ap);
|
|
|
|
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
}
|
|
|
|
return formatted_bytes;
|
|
|
|
return formatted_bytes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -2024,6 +2030,9 @@ void sd_card_load_config(char *filename){
|
|
|
|
if (f_open(fs_file, filename, FA_OPEN_EXISTING | FA_READ) != FR_OK)
|
|
|
|
if (f_open(fs_file, filename, FA_OPEN_EXISTING | FA_READ) != FR_OK)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseSequentialStream *old_shell_stream = shell_stream;
|
|
|
|
|
|
|
|
shell_stream = (BaseSequentialStream *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
char *buf = (char *)spi_buffer;
|
|
|
|
char *buf = (char *)spi_buffer;
|
|
|
|
UINT size = 0;
|
|
|
|
UINT size = 0;
|
|
|
|
|
|
|
|
|
|
|
|
@ -2052,6 +2061,7 @@ void sd_card_load_config(char *filename){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
f_close(fs_file);
|
|
|
|
f_close(fs_file);
|
|
|
|
|
|
|
|
shell_stream = old_shell_stream;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@ -2272,10 +2282,6 @@ int main(void)
|
|
|
|
|
|
|
|
|
|
|
|
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO-1, Thread1, NULL);
|
|
|
|
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO-1, Thread1, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __SD_CARD_LOAD__
|
|
|
|
|
|
|
|
sd_card_load_config("config.ini");
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
while (1) {
|
|
|
|
// if (SDU1.config->usbp->state == USB_ACTIVE) {
|
|
|
|
// if (SDU1.config->usbp->state == USB_ACTIVE) {
|
|
|
|
if (shell_check_connect()) {
|
|
|
|
if (shell_check_connect()) {
|
|
|
|
|