mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-24 01:56:25 +03:00
s/\bleds_t\b/Leds/g
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
#define CHECK 15 // Check LED needs changing
|
||||
|
||||
// Keep track of LED status and set LED 0 .. LED_N-1 physically on or off
|
||||
static void led_direct(const PROGRAMMER *pgm, leds_t *ls, int led, int what) {
|
||||
static void led_direct(const PROGRAMMER *pgm, Leds *ls, int led, int what) {
|
||||
if(what ^ !!(ls->phy & (1<<led))) {
|
||||
switch(led) {
|
||||
case LED_RDY:
|
||||
@@ -82,7 +82,7 @@ static void led_direct(const PROGRAMMER *pgm, leds_t *ls, int led, int what) {
|
||||
}
|
||||
|
||||
// Physical level of LED setting, deal with max blinking frequency LED_FMAX
|
||||
static void led_physical(const PROGRAMMER *pgm, leds_t *ls, int led, int what) {
|
||||
static void led_physical(const PROGRAMMER *pgm, Leds *ls, int led, int what) {
|
||||
if(led < 0 || led >= LED_N) // Sanity
|
||||
return;
|
||||
|
||||
@@ -125,7 +125,7 @@ static void led_physical(const PROGRAMMER *pgm, leds_t *ls, int led, int what) {
|
||||
// Logical level of setting LEDs, passes on to physical level
|
||||
int led_set(const PROGRAMMER *pgm, int led) {
|
||||
// leds should always be allocated, but if not use dummy
|
||||
leds_t sanity = { 0, 0, 0, 0, 0, {0, } }, *ls = pgm->leds? pgm->leds: &sanity;
|
||||
Leds sanity = { 0, 0, 0, 0, 0, {0, } }, *ls = pgm->leds? pgm->leds: &sanity;
|
||||
int what = led >= 0 && led < LED_N && !(ls->now & (1<<led))? TON: CHECK;
|
||||
|
||||
switch(led) {
|
||||
@@ -174,7 +174,7 @@ int led_clr(const PROGRAMMER *pgm, int led) {
|
||||
}
|
||||
|
||||
// pgm->leds should always be allocated, but if not use dummy
|
||||
leds_t sanity = { 0, 0, 0, 0, 0, {0, } }, *ls = pgm->leds? pgm->leds: &sanity;
|
||||
Leds sanity = { 0, 0, 0, 0, 0, {0, } }, *ls = pgm->leds? pgm->leds: &sanity;
|
||||
int what = ls->now & (1<<led)? TOFF: CHECK;
|
||||
|
||||
// Record logical level
|
||||
|
||||
@@ -924,7 +924,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
int now, chg, phy, end, set; // LED states (current, change needed next period, physical, at end, ever set)
|
||||
unsigned long ms[LED_N]; // Time in ms after last physical change
|
||||
} leds_t;
|
||||
} Leds;
|
||||
|
||||
/*
|
||||
* Any changes in PROGRAMMER, please also ensure changes are made in
|
||||
@@ -959,7 +959,7 @@ typedef struct programmer {
|
||||
char type[PGM_TYPELEN];
|
||||
const char *port;
|
||||
unsigned int pinno[N_PINS]; // TODO to be removed if old pin data no longer needed
|
||||
Exit_vcc exit_vcc; // Should these be set in avrdude.conf?
|
||||
Exit_vcc exit_vcc; // Should these be set in avrdude.conf?
|
||||
Exit_reset exit_reset;
|
||||
Exit_datahigh exit_datahigh;
|
||||
int ppidata;
|
||||
@@ -967,7 +967,7 @@ typedef struct programmer {
|
||||
int ispdelay; // ISP clock delay
|
||||
int page_size; // Page size if the programmer supports paged write/load
|
||||
double bitclock; // JTAG ICE clock period in microseconds
|
||||
leds_t *leds; // State of LEDs as tracked by led_...() functions in leds.c
|
||||
Leds *leds; // State of LEDs as tracked by led_...() functions in leds.c
|
||||
|
||||
int (*rdy_led) (const PROGRAMMER *pgm, int value);
|
||||
int (*err_led) (const PROGRAMMER *pgm, int value);
|
||||
|
||||
@@ -169,7 +169,7 @@ PROGRAMMER *pgm_new(void) {
|
||||
pin_clear_all(&(pgm->pin[i]));
|
||||
}
|
||||
|
||||
pgm->leds = mmt_malloc(sizeof(leds_t));
|
||||
pgm->leds = mmt_malloc(sizeof(Leds));
|
||||
|
||||
pgm_init_functions(pgm);
|
||||
|
||||
@@ -218,7 +218,7 @@ PROGRAMMER *pgm_dup(const PROGRAMMER *src) {
|
||||
if(pgm->cp_usersig)
|
||||
mmt_free(pgm->cp_usersig);
|
||||
|
||||
leds_t *ls = pgm->leds;
|
||||
Leds *ls = pgm->leds;
|
||||
memcpy(pgm, src, sizeof(*pgm));
|
||||
if(ls && src->leds)
|
||||
memcpy(ls, src->leds, sizeof *ls);
|
||||
|
||||
Reference in New Issue
Block a user