sonarlint the clocks

This commit is contained in:
Jasmine Iwanek
2023-07-31 17:30:02 -04:00
parent 73757d11c6
commit 060a1761e2
3 changed files with 21 additions and 12 deletions

View File

@@ -34,9 +34,12 @@
typedef struct icd2061_t { typedef struct icd2061_t {
float freq[3]; float freq[3];
int count, bit_count, int count;
unlocked, state; int bit_count;
uint32_t data, ctrl; int unlocked;
int state;
uint32_t data;
uint32_t ctrl;
} icd2061_t; } icd2061_t;
#ifdef ENABLE_ICD2061_LOG #ifdef ENABLE_ICD2061_LOG
@@ -138,7 +141,7 @@ icd2061_write(void *p, int val)
float float
icd2061_getclock(int clock, void *priv) icd2061_getclock(int clock, void *priv)
{ {
icd2061_t *icd2061 = (icd2061_t *) priv; const icd2061_t *icd2061 = (icd2061_t *) priv;
if (clock > 2) if (clock > 2)
clock = 2; clock = 2;

View File

@@ -51,7 +51,7 @@ ics2494_log(const char *fmt, ...)
float float
ics2494_getclock(int clock, void *priv) ics2494_getclock(int clock, void *priv)
{ {
ics2494_t *ics2494 = (ics2494_t *) priv; const ics2494_t *ics2494 = (ics2494_t *) priv;
if (clock > 15) if (clock > 15)
clock = 15; clock = 15;
@@ -85,6 +85,9 @@ ics2494_init(const device_t *info)
ics2494->freq[0xe] = 75000000.0; ics2494->freq[0xe] = 75000000.0;
ics2494->freq[0xf] = 94500000.0; ics2494->freq[0xf] = 94500000.0;
break; break;
default:
break;
} }
return ics2494; return ics2494;

View File

@@ -26,9 +26,11 @@
#include <86box/plat_unused.h> #include <86box/plat_unused.h>
typedef struct ics2595_t { typedef struct ics2595_t {
int oldfs3, oldfs2; int oldfs3;
int oldfs2;
int dat; int dat;
int pos, state; int pos;
int state;
double clocks[16]; double clocks[16];
double output_clock; double output_clock;
@@ -43,9 +45,9 @@ enum {
static int ics2595_div[4] = { 8, 4, 2, 1 }; static int ics2595_div[4] = { 8, 4, 2, 1 };
void void
ics2595_write(void *p, int strobe, int dat) ics2595_write(void *priv, int strobe, int dat)
{ {
ics2595_t *ics2595 = (ics2595_t *) p; ics2595_t *ics2595 = (ics2595_t *) priv;
int d; int d;
int n; int n;
int l; int l;
@@ -88,6 +90,7 @@ static void *
ics2595_init(UNUSED(const device_t *info)) ics2595_init(UNUSED(const device_t *info))
{ {
ics2595_t *ics2595 = (ics2595_t *) malloc(sizeof(ics2595_t)); ics2595_t *ics2595 = (ics2595_t *) malloc(sizeof(ics2595_t));
memset(ics2595, 0, sizeof(ics2595_t)); memset(ics2595, 0, sizeof(ics2595_t));
return ics2595; return ics2595;
@@ -105,15 +108,15 @@ ics2595_close(void *priv)
double double
ics2595_getclock(void *priv) ics2595_getclock(void *priv)
{ {
ics2595_t *ics2595 = (ics2595_t *) priv; const ics2595_t *ics2595 = (ics2595_t *) priv;
return ics2595->output_clock; return ics2595->output_clock;
} }
void void
ics2595_setclock(void *p, double clock) ics2595_setclock(void *priv, double clock)
{ {
ics2595_t *ics2595 = (ics2595_t *) p; ics2595_t *ics2595 = (ics2595_t *) priv;
ics2595->output_clock = clock; ics2595->output_clock = clock;
} }