asix-sigma: nits in the list of firmware files
Eliminate an unnecessary magic number for the maximum filename length of SIGMA netlists. Use a more compact source code phrase to "unclutter" the list of filenames and their features/purpose. Move the filesize limit to the list of files to simplify future maintenance.
This commit is contained in:
parent
97aa41e9b5
commit
742368a2bc
src/hardware/asix-sigma
|
@ -47,19 +47,16 @@ SR_PRIV const uint64_t samplerates[] = {
|
||||||
|
|
||||||
SR_PRIV const size_t samplerates_count = ARRAY_SIZE(samplerates);
|
SR_PRIV const size_t samplerates_count = ARRAY_SIZE(samplerates);
|
||||||
|
|
||||||
static const char firmware_files[][24] = {
|
static const char *firmware_files[] = {
|
||||||
/* 50 MHz, supports 8 bit fractions */
|
"asix-sigma-50.fw", /* Up to 50MHz sample rate, 8bit divider. */
|
||||||
"asix-sigma-50.fw",
|
"asix-sigma-100.fw", /* 100MHz sample rate, fixed. */
|
||||||
/* 100 MHz */
|
"asix-sigma-200.fw", /* 200MHz sample rate, fixed. */
|
||||||
"asix-sigma-100.fw",
|
"asix-sigma-50sync.fw", /* Synchronous clock from external pin. */
|
||||||
/* 200 MHz */
|
"asix-sigma-phasor.fw", /* Frequency counter. */
|
||||||
"asix-sigma-200.fw",
|
|
||||||
/* Synchronous clock from pin */
|
|
||||||
"asix-sigma-50sync.fw",
|
|
||||||
/* Frequency counter */
|
|
||||||
"asix-sigma-phasor.fw",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SIGMA_FIRMWARE_SIZE_LIMIT (256 * 1024)
|
||||||
|
|
||||||
static int sigma_read(void *buf, size_t size, struct dev_context *devc)
|
static int sigma_read(void *buf, size_t size, struct dev_context *devc)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -370,8 +367,8 @@ static int sigma_fw_2_bitbang(struct sr_context *ctx, const char *name,
|
||||||
int ret = SR_OK;
|
int ret = SR_OK;
|
||||||
|
|
||||||
/* Retrieve the on-disk firmware file content. */
|
/* Retrieve the on-disk firmware file content. */
|
||||||
firmware = sr_resource_load(ctx, SR_RESOURCE_FIRMWARE,
|
firmware = sr_resource_load(ctx, SR_RESOURCE_FIRMWARE, name,
|
||||||
name, &file_size, 256 * 1024);
|
&file_size, SIGMA_FIRMWARE_SIZE_LIMIT);
|
||||||
if (!firmware)
|
if (!firmware)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue