Merge pull request #52 from erikkaashoek/DiSlord_browser

Di slord browser
pwm
erikkaashoek 3 years ago committed by GitHub
commit 4159b89d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,6 +19,12 @@ enthusiast.
This repository contains source of tinySA firmware. This repository contains source of tinySA firmware.
# Support
General tinySA support questions should be posted here: https://groups.io/g/tinysa/messages
Use github issue list only for firmware bugs and preferrably cross post to: https://groups.io/g/tinysa/messages
## Prepare ARM Cross Tools ## Prepare ARM Cross Tools
**UPDATE**: Recent gcc version works to build tinySA, no need old version. **UPDATE**: Recent gcc version works to build tinySA, no need old version.
@ -54,6 +60,10 @@ Just make in the directory.
$ make $ make
For tinySA Ultra use this command
$ make TARGET="F303"
### Build firmware using docker ### Build firmware using docker
Using [this docker image](https://hub.docker.com/r/edy555/arm-embedded) and without installing arm toolchain, you can build the firmware. Using [this docker image](https://hub.docker.com/r/edy555/arm-embedded) and without installing arm toolchain, you can build the firmware.

@ -857,7 +857,7 @@ VNA_SHELL_FUNCTION(cmd_capture)
static FRESULT cmd_sd_card_mount(void){ static FRESULT cmd_sd_card_mount(void){
const FRESULT res = f_mount(fs_volume, "", 1); const FRESULT res = f_mount(fs_volume, "", 1);
if (res != FR_OK) if (res != FR_OK)
shell_printf("err %d: no card\r\n",res); shell_printf("err: (%d) no card\r\n",res);
return res; return res;
} }
@ -885,49 +885,43 @@ VNA_SHELL_FUNCTION(cmd_sd_list)
res = f_findnext(&dj, &fno); res = f_findnext(&dj, &fno);
} }
if (res != FR_OK) if (res != FR_OK)
shell_printf("err %d\r\n",res); shell_printf("err: (%d)\r\n",res);
f_closedir(&dj); f_closedir(&dj);
} }
VNA_SHELL_FUNCTION(cmd_sd_read) VNA_SHELL_FUNCTION(cmd_sd_read)
{ {
DIR dj; // DIR dj;
FILINFO fno; // FILINFO fno;
FRESULT res; FRESULT res;
char *buf = (char *)spi_buffer; char *buf = (char *)spi_buffer;
if (argc != 1 || argv[0][0] == '?') if (argc != 1 || argv[0][0] == '?')
{ {
usage_printf("sd_read {filename}\r\n"); usage_printf("usage: sd_read {filename}\r\n");
return; return;
} }
const char *filename = argv[0]; const char *filename = argv[0];
if (cmd_sd_card_mount() != FR_OK) if (cmd_sd_card_mount() != FR_OK)
return; return;
res = f_findfirst(&dj, &fno, "", filename); // res = f_findfirst(&dj, &fno, "", filename);
if (res != FR_OK || fno.fname[0] == 0) // if (res != FR_OK || fno.fname[0] == 0)
goto error; // goto error;
if ((res = f_open(fs_file, filename, FA_OPEN_EXISTING | FA_READ)) != FR_OK){
if (f_open(fs_file, fno.fname, FA_OPEN_EXISTING | FA_READ) != FR_OK){ //error:
error: shell_printf("err: (%d) no file\r\n", res);
shell_printf("err %d: no file\r\n",res);
return; return;
} }
// shell_printf("sd_read: %s\r\n", filename);
// number of bytes to follow (file size) // number of bytes to follow (file size)
uint32_t filesize = f_size(fs_file); uint32_t filesize = f_size(fs_file);
#if 1
shell_printf("%u\r\n", filesize);
#else
streamWrite(shell_stream, (void *)&filesize, 4); streamWrite(shell_stream, (void *)&filesize, 4);
#endif
UINT size = 0; UINT size = 0;
// file data (send all data from file) // file data (send all data from file)
while ((res=f_read(fs_file, buf, 512, &size)) == FR_OK && size > 0) while ((res=f_read(fs_file, buf, 512, &size)) == FR_OK && size > 0)
streamWrite(shell_stream, (void *)buf, size); streamWrite(shell_stream, (void *)buf, size);
if (res != FR_OK) // if (res != FR_OK)
goto error; // goto error;
f_close(fs_file); f_close(fs_file);
return; return;
} }

@ -1384,7 +1384,7 @@ typedef struct properties {
//sizeof(properties_t) == 0x1200 //sizeof(properties_t) == 0x1200
#define CONFIG_MAGIC 0x434f4e5D /* 'CONF' */ #define CONFIG_MAGIC 0x434f4e5F /* 'CONF' */
extern int16_t lastsaveid; extern int16_t lastsaveid;
//extern properties_t *active_props; //extern properties_t *active_props;

Loading…
Cancel
Save

Powered by TurnKey Linux.