diff options
author | Harald Welte <laforge@gnumonks.org> | 2015-09-28 17:00:51 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2015-09-28 17:02:22 +0200 |
commit | 21391e0bdbe676ab766204eaa0eddd46e529c849 (patch) | |
tree | a47c5305e5363c4dff8d4dabdc82750dc877a64b /firmware/src/os | |
parent | 5a40e2fed18ed75c7b8d62f52cf4a7c660a8e026 (diff) |
convert from u_int*_t to uint*_t
Diffstat (limited to 'firmware/src/os')
-rw-r--r-- | firmware/src/os/blinkcode.c | 2 | ||||
-rw-r--r-- | firmware/src/os/dbgu.c | 2 | ||||
-rw-r--r-- | firmware/src/os/fifo.c | 14 | ||||
-rw-r--r-- | firmware/src/os/fifo.h | 26 | ||||
-rw-r--r-- | firmware/src/os/flash.c | 18 | ||||
-rw-r--r-- | firmware/src/os/flash.h | 2 | ||||
-rw-r--r-- | firmware/src/os/pcd_enumerate.c | 20 | ||||
-rw-r--r-- | firmware/src/os/pio_irq.c | 28 | ||||
-rw-r--r-- | firmware/src/os/pio_irq.h | 10 | ||||
-rw-r--r-- | firmware/src/os/pit.c | 10 | ||||
-rw-r--r-- | firmware/src/os/pit.h | 2 | ||||
-rw-r--r-- | firmware/src/os/pwm.c | 20 | ||||
-rw-r--r-- | firmware/src/os/pwm.h | 4 | ||||
-rw-r--r-- | firmware/src/os/req_ctx.c | 6 | ||||
-rw-r--r-- | firmware/src/os/req_ctx.h | 10 | ||||
-rw-r--r-- | firmware/src/os/system_irq.c | 4 | ||||
-rw-r--r-- | firmware/src/os/system_irq.h | 2 | ||||
-rw-r--r-- | firmware/src/os/tc_cdiv.c | 2 | ||||
-rw-r--r-- | firmware/src/os/tc_cdiv.h | 2 | ||||
-rw-r--r-- | firmware/src/os/usb_handler.c | 4 | ||||
-rw-r--r-- | firmware/src/os/usb_handler.h | 4 | ||||
-rw-r--r-- | firmware/src/os/usbcmd_generic.c | 12 | ||||
-rw-r--r-- | firmware/src/os/usbcmd_generic.h | 4 | ||||
-rw-r--r-- | firmware/src/os/wdt.c | 2 |
24 files changed, 105 insertions, 105 deletions
diff --git a/firmware/src/os/blinkcode.c b/firmware/src/os/blinkcode.c index 22d4b25..9e88716 100644 --- a/firmware/src/os/blinkcode.c +++ b/firmware/src/os/blinkcode.c @@ -28,7 +28,7 @@ struct blinker { enum blinkcode_state state; int num; int cur; - u_int8_t led; + uint8_t led; }; static struct blinker blink_state[NUM_LEDS]; diff --git a/firmware/src/os/dbgu.c b/firmware/src/os/dbgu.c index 72eaa88..7f1df44 100644 --- a/firmware/src/os/dbgu.c +++ b/firmware/src/os/dbgu.c @@ -78,7 +78,7 @@ static void Send_reset(void) //* Object : C handler interrupt function called by the sysirq //* demultiplexer //*---------------------------------------------------------------------------- -static void DBGU_irq_handler(u_int32_t sr) +static void DBGU_irq_handler(uint32_t sr) { static char value; diff --git a/firmware/src/os/fifo.c b/firmware/src/os/fifo.c index c30ba10..40aa0d0 100644 --- a/firmware/src/os/fifo.c +++ b/firmware/src/os/fifo.c @@ -58,7 +58,7 @@ void fifo_check_raise_int(struct fifo *fifo) } -u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) +uint16_t fifo_data_put(struct fifo *fifo, uint16_t len, uint8_t *data) { if (len > fifo_available(fifo)) { len = fifo_available(fifo); @@ -71,7 +71,7 @@ u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) fifo->producer += len; } else { /* difficult: wrap around */ - u_int16_t chunk_len; + uint16_t chunk_len; chunk_len = fifo->size - fifo->producer; memcpy(&fifo->data[fifo->producer], data, chunk_len); @@ -86,9 +86,9 @@ u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data) } -u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) +uint16_t fifo_data_get(struct fifo *fifo, uint16_t len, uint8_t *data) { - u_int16_t avail = fifo_available(fifo); + uint16_t avail = fifo_available(fifo); if (avail < len) len = avail; @@ -98,7 +98,7 @@ u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) memcpy(data, &fifo->data[fifo->consumer], len); } else { /* difficult case: wrap */ - u_int16_t chunk_len = fifo->size - fifo->consumer; + uint16_t chunk_len = fifo->size - fifo->consumer; memcpy(data, &fifo->data[fifo->consumer], chunk_len); memcpy(data+chunk_len, &fifo->data[0], len - chunk_len); } @@ -108,8 +108,8 @@ u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data) return len; } -int fifo_init(struct fifo *fifo, u_int16_t size, - void (*cb)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data) +int fifo_init(struct fifo *fifo, uint16_t size, + void (*cb)(struct fifo *fifo, uint8_t event, void *data), void *cb_data) { if (size > sizeof(fifo->data)) return -EINVAL; diff --git a/firmware/src/os/fifo.h b/firmware/src/os/fifo.h index d91c6c2..0b2f8e7 100644 --- a/firmware/src/os/fifo.h +++ b/firmware/src/os/fifo.h @@ -6,23 +6,23 @@ #define FIFO_SIZE 1024 struct fifo { - u_int16_t size; /* actual FIFO size, can be smaller than 'data' */ - u_int16_t producer; /* index of producer */ - u_int16_t consumer; /* index of consumer */ - u_int16_t watermark; - u_int8_t irq; - u_int8_t irq_en; - u_int8_t status; - void (*callback)(struct fifo *fifo, u_int8_t event, void *data); + uint16_t size; /* actual FIFO size, can be smaller than 'data' */ + uint16_t producer; /* index of producer */ + uint16_t consumer; /* index of consumer */ + uint16_t watermark; + uint8_t irq; + uint8_t irq_en; + uint8_t status; + void (*callback)(struct fifo *fifo, uint8_t event, void *data); void *cb_data; - u_int8_t data[FIFO_SIZE]; + uint8_t data[FIFO_SIZE]; }; -extern int fifo_init(struct fifo *fifo, u_int16_t size, - void (*callback)(struct fifo *fifo, u_int8_t event, void *data), void *cb_data); -extern u_int16_t fifo_data_get(struct fifo *fifo, u_int16_t len, u_int8_t *data); -extern u_int16_t fifo_data_put(struct fifo *fifo, u_int16_t len, u_int8_t *data); +extern int fifo_init(struct fifo *fifo, uint16_t size, + void (*callback)(struct fifo *fifo, uint8_t event, void *data), void *cb_data); +extern uint16_t fifo_data_get(struct fifo *fifo, uint16_t len, uint8_t *data); +extern uint16_t fifo_data_put(struct fifo *fifo, uint16_t len, uint8_t *data); extern int fifo_available(struct fifo *fifo); #endif diff --git a/firmware/src/os/flash.c b/firmware/src/os/flash.c index c729ff8..dabc033 100644 --- a/firmware/src/os/flash.c +++ b/firmware/src/os/flash.c @@ -13,34 +13,34 @@ #define EFCS_CMD_CLEAR_NVM_BIT 0xd #define EFCS_CMD_SET_SECURITY_BIT 0xf -static u_int16_t page_from_ramaddr(const void *addr) +static uint16_t page_from_ramaddr(const void *addr) { - u_int32_t ramaddr = (u_int32_t) addr; - ramaddr -= (u_int32_t) AT91C_IFLASH; + uint32_t ramaddr = (uint32_t) addr; + ramaddr -= (uint32_t) AT91C_IFLASH; return ((ramaddr >> AT91C_IFLASH_PAGE_SHIFT)); } #define PAGES_PER_LOCKREGION (AT91C_IFLASH_LOCK_REGION_SIZE>>AT91C_IFLASH_PAGE_SHIFT) #define IS_FIRST_PAGE_OF_LOCKREGION(x) ((x % PAGES_PER_LOCKREGION) == 0) #define LOCKREGION_FROM_PAGE(x) (x / PAGES_PER_LOCKREGION) -static int is_page_locked(u_int16_t page) +static int is_page_locked(uint16_t page) { - u_int16_t lockregion = LOCKREGION_FROM_PAGE(page); + uint16_t lockregion = LOCKREGION_FROM_PAGE(page); return (AT91C_BASE_MC->MC_FSR & (lockregion << 16)); } -static void unlock_page(u_int16_t page) +static void unlock_page(uint16_t page) { page &= 0x3ff; AT91F_MC_EFC_PerformCmd(AT91C_BASE_MC, AT91C_MC_FCMD_UNLOCK | AT91C_MC_CORRECT_KEY | (page << 8)); } -void flash_page(u_int8_t *addr) +void flash_page(uint8_t *addr) { - u_int16_t page = page_from_ramaddr(addr) & 0x3ff; - u_int32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); + uint16_t page = page_from_ramaddr(addr) & 0x3ff; + uint32_t fsr = AT91F_MC_EFC_GetStatus(AT91C_BASE_MC); DEBUGP("flash_page(0x%x=%u) ", addr, page); if (is_page_locked(page)) { diff --git a/firmware/src/os/flash.h b/firmware/src/os/flash.h index b812714..b31d167 100644 --- a/firmware/src/os/flash.h +++ b/firmware/src/os/flash.h @@ -1,5 +1,5 @@ #ifndef _FLASH_H #define _FLASH_H -extern void flash_page(u_int8_t *addr); +extern void flash_page(uint8_t *addr); extern void flash_init(void); #endif diff --git a/firmware/src/os/pcd_enumerate.c b/firmware/src/os/pcd_enumerate.c index 403cef9..0daa2c8 100644 --- a/firmware/src/os/pcd_enumerate.c +++ b/firmware/src/os/pcd_enumerate.c @@ -94,8 +94,8 @@ static const struct dfuapi *dfu = DFU_API_LOCATION; static struct udp_pcd upcd; struct epstate { - u_int32_t state_busy; - u_int32_t state_pending; + uint32_t state_busy; + uint32_t state_pending; }; static const struct epstate epstate[] = { @@ -140,7 +140,7 @@ void udp_unthrottle(void) int udp_refill_ep(int ep) { - u_int16_t i; + uint16_t i; AT91PS_UDP pUDP = upcd.pUdp; struct req_ctx *rctx; unsigned int start, end; @@ -231,7 +231,7 @@ int udp_refill_ep(int ep) static void udp_irq(void) { - u_int32_t csr; + uint32_t csr; AT91PS_UDP pUDP = upcd.pUdp; AT91_REG isr = pUDP->UDP_ISR; @@ -270,8 +270,8 @@ static void udp_irq(void) udp_ep0_handler(); } if (isr & AT91C_UDP_EPINT1) { - u_int32_t cur_rcv_bank = upcd.cur_rcv_bank; - u_int16_t i, pkt_size; + uint32_t cur_rcv_bank = upcd.cur_rcv_bank; + uint16_t i, pkt_size; struct req_ctx *rctx; csr = pUDP->UDP_CSR[1]; @@ -471,9 +471,9 @@ void udp_reset(void) static void udp_ep0_handler(void) { AT91PS_UDP pUDP = upcd.pUdp; - u_int8_t bmRequestType, bRequest; - u_int16_t wValue, wIndex, wLength, wStatus; - u_int32_t csr = pUDP->UDP_CSR[0]; + uint8_t bmRequestType, bRequest; + uint16_t wValue, wIndex, wLength, wStatus; + uint32_t csr = pUDP->UDP_CSR[0]; DEBUGE("CSR=0x%04x ", csr); @@ -521,7 +521,7 @@ static void udp_ep0_handler(void) /* Handle supported standard device request Cf Table 9-3 in USB * speciication Rev 1.1 */ switch ((bRequest << 8) | bmRequestType) { - u_int8_t desc_type, desc_index; + uint8_t desc_type, desc_index; case STD_GET_DESCRIPTOR: DEBUGE("GET_DESCRIPTOR(wValue=0x%04x, wIndex=0x%04x) ", wValue, wIndex); diff --git a/firmware/src/os/pio_irq.c b/firmware/src/os/pio_irq.c index d11bd47..921fdf3 100644 --- a/firmware/src/os/pio_irq.c +++ b/firmware/src/os/pio_irq.c @@ -27,17 +27,17 @@ struct pioirq_state { irq_handler_t *handlers[NR_PIO]; - u_int32_t usbmask; - u_int32_t usb_throttled; /* atomic? */ + uint32_t usbmask; + uint32_t usb_throttled; /* atomic? */ }; static struct pioirq_state pirqs; /* low-level handler, used by Cstartup_app.S PIOA fast forcing and * by regular interrupt handler below */ -void __ramfunc __pio_irq_demux(u_int32_t pio) +void __ramfunc __pio_irq_demux(uint32_t pio) { - u_int8_t send_usb = 0; + uint8_t send_usb = 0; int i; //DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio); @@ -59,15 +59,15 @@ void __ramfunc __pio_irq_demux(u_int32_t pio) pirqs.usb_throttled = 1; } else { struct openpcd_hdr *opcdh; - u_int32_t *regmask; + uint32_t *regmask; opcdh = (struct openpcd_hdr *) irq_rctx->data; - regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); + regmask = (uint32_t *) (irq_rctx->data + sizeof(*opcdh)); opcdh->cmd = OPENPCD_CMD_PIO_IRQ; opcdh->reg = 0x00; opcdh->flags = 0x00; opcdh->val = 0x00; - irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(uint32_t); req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); } } @@ -78,23 +78,23 @@ void __ramfunc __pio_irq_demux(u_int32_t pio) /* regular interrupt handler, in case fast forcing for PIOA disabled */ static void pio_irq_demux(void) { - u_int32_t pio = AT91F_PIO_GetInterruptStatus(AT91C_BASE_PIOA); + uint32_t pio = AT91F_PIO_GetInterruptStatus(AT91C_BASE_PIOA); __pio_irq_demux(pio); } -void pio_irq_enable(u_int32_t pio) +void pio_irq_enable(uint32_t pio) { AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, pio); } -void pio_irq_disable(u_int32_t pio) +void pio_irq_disable(uint32_t pio) { AT91F_PIO_InterruptDisable(AT91C_BASE_PIOA, pio); } -int pio_irq_register(u_int32_t pio, irq_handler_t *handler) +int pio_irq_register(uint32_t pio, irq_handler_t *handler) { - u_int8_t num = ffs(pio); + uint8_t num = ffs(pio); if (num == 0) return -EINVAL; @@ -111,9 +111,9 @@ int pio_irq_register(u_int32_t pio, irq_handler_t *handler) return 0; } -void pio_irq_unregister(u_int32_t pio) +void pio_irq_unregister(uint32_t pio) { - u_int8_t num = ffs(pio); + uint8_t num = ffs(pio); if (num == 0) return; diff --git a/firmware/src/os/pio_irq.h b/firmware/src/os/pio_irq.h index 33f4656..b782821 100644 --- a/firmware/src/os/pio_irq.h +++ b/firmware/src/os/pio_irq.h @@ -2,12 +2,12 @@ #define _PIO_IRQ_H #define NR_PIO 32 -typedef void irq_handler_t(u_int32_t pio); +typedef void irq_handler_t(uint32_t pio); -extern void pio_irq_enable(u_int32_t pio); -extern void pio_irq_disable(u_int32_t pio); -extern int pio_irq_register(u_int32_t pio, irq_handler_t *func); -extern void pio_irq_unregister(u_int32_t pio); +extern void pio_irq_enable(uint32_t pio); +extern void pio_irq_disable(uint32_t pio); +extern int pio_irq_register(uint32_t pio, irq_handler_t *func); +extern void pio_irq_unregister(uint32_t pio); extern void pio_irq_init(void); #endif diff --git a/firmware/src/os/pit.c b/firmware/src/os/pit.c index 50ec19f..e442265 100644 --- a/firmware/src/os/pit.c +++ b/firmware/src/os/pit.c @@ -103,7 +103,7 @@ void timer_add(struct timer_list *tl) local_irq_restore(flags); } -static void pit_irq(u_int32_t sr) +static void pit_irq(uint32_t sr) { struct timer_list *tl, *next; @@ -125,21 +125,21 @@ static void pit_irq(u_int32_t sr) } } -void pit_mdelay(u_int32_t ms) +void pit_mdelay(uint32_t ms) { - u_int32_t end; + uint32_t end; end = (AT91F_PITGetPIIR(AT91C_BASE_PITC) + ms) % 20; while (end < AT91F_PITGetPIIR(AT91C_BASE_PITC)) { } } -void mdelay(u_int32_t ms) +void mdelay(uint32_t ms) { return pit_mdelay(ms); } -void usleep(u_int32_t us) +void usleep(uint32_t us) { return; return pit_mdelay(us/1000); diff --git a/firmware/src/os/pit.h b/firmware/src/os/pit.h index 4a25cc1..4ac717e 100644 --- a/firmware/src/os/pit.h +++ b/firmware/src/os/pit.h @@ -20,6 +20,6 @@ extern void timer_add(struct timer_list *timer); extern int timer_del(struct timer_list *timer); extern void pit_init(void); -extern void pit_mdelay(u_int32_t ms); +extern void pit_mdelay(uint32_t ms); #endif diff --git a/firmware/src/os/pwm.c b/firmware/src/os/pwm.c index 70858bb..14b9b6c 100644 --- a/firmware/src/os/pwm.c +++ b/firmware/src/os/pwm.c @@ -42,7 +42,7 @@ static AT91PS_PWMC pwm = AT91C_BASE_PWMC; /* find highest bit set. returns bit (32..1) or 0 in case no bit set */ -static int fhs(u_int32_t val) +static int fhs(uint32_t val) { int i; @@ -55,16 +55,16 @@ static int fhs(u_int32_t val) } /* set frequency of PWM signal to freq */ -int pwm_freq_set(int channel, u_int32_t freq) +int pwm_freq_set(int channel, uint32_t freq) { /* in order to get maximum resolution, the pre-scaler must be set to * something like freq << 16. However, the mimimum pre-scaled frequency * we can get is MCLK (48MHz), the minimum is MCLK/(1024*255) = * 48MHz/261120 = 183Hz */ - u_int32_t overall_div; - u_int32_t presc_total; - u_int8_t cpre = 0; - u_int16_t cprd; + uint32_t overall_div; + uint32_t presc_total; + uint8_t cpre = 0; + uint16_t cprd; if (freq > MCLK) return -ERANGE; @@ -104,9 +104,9 @@ void pwm_stop(int channel) AT91F_PWMC_StopChannel(AT91C_BASE_PWMC, (1 << channel)); } -void pwm_duty_set_percent(int channel, u_int16_t duty) +void pwm_duty_set_percent(int channel, uint16_t duty) { - u_int32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; + uint32_t tmp = pwm->PWMC_CH[channel].PWMC_CPRDR & 0xffff; tmp = tmp << 16; /* extend value by 2^16 */ tmp = tmp / 100; /* tmp = 1 % of extended cprd */ @@ -120,7 +120,7 @@ void pwm_duty_set_percent(int channel, u_int16_t duty) static int pwm_usb_in(struct req_ctx *rctx) { struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; - u_int32_t *freq; + uint32_t *freq; switch (poh->cmd) { case OPENPCD_CMD_PWM_ENABLE: @@ -138,7 +138,7 @@ static int pwm_usb_in(struct req_ctx *rctx) case OPENPCD_CMD_PWM_FREQ_SET: if (rctx->tot_len < sizeof(*poh)+4) break; - freq = (u_int32_t *) ((unsigned char *) poh) + sizeof(*poh); + freq = (uint32_t *) ((unsigned char *) poh) + sizeof(*poh); pwm_freq_set(0, *freq); break; case OPENPCD_CMD_PWM_FREQ_GET: diff --git a/firmware/src/os/pwm.h b/firmware/src/os/pwm.h index 8836c32..bde34f6 100644 --- a/firmware/src/os/pwm.h +++ b/firmware/src/os/pwm.h @@ -1,10 +1,10 @@ #ifndef _PWM_H #define _PWM_H -extern void pwm_freq_set(int channel, u_int32_t freq); +extern void pwm_freq_set(int channel, uint32_t freq); extern void pwm_start(int channel); extern void pwm_stop(int channel); -extern void pwm_duty_set_percent(int channel, u_int16_t duty); +extern void pwm_duty_set_percent(int channel, uint16_t duty); extern void pwm_init(void); extern void pwm_fini(void); diff --git a/firmware/src/os/req_ctx.c b/firmware/src/os/req_ctx.c index 722c099..9aba813 100644 --- a/firmware/src/os/req_ctx.c +++ b/firmware/src/os/req_ctx.c @@ -38,8 +38,8 @@ #define NUM_REQ_CTX (NUM_RCTX_SMALL+NUM_RCTX_LARGE) -static u_int8_t rctx_data[NUM_RCTX_SMALL][RCTX_SIZE_SMALL]; -static u_int8_t rctx_data_large[NUM_RCTX_LARGE][RCTX_SIZE_LARGE]; +static uint8_t rctx_data[NUM_RCTX_SMALL][RCTX_SIZE_SMALL]; +static uint8_t rctx_data_large[NUM_RCTX_LARGE][RCTX_SIZE_LARGE]; static struct req_ctx req_ctx[NUM_REQ_CTX]; @@ -79,7 +79,7 @@ struct req_ctx __ramfunc *req_ctx_find_get(int large, return toReturn; } -u_int8_t req_ctx_num(struct req_ctx *ctx) +uint8_t req_ctx_num(struct req_ctx *ctx) { return ctx - req_ctx; } diff --git a/firmware/src/os/req_ctx.h b/firmware/src/os/req_ctx.h index 92c21a7..2b7ca60 100644 --- a/firmware/src/os/req_ctx.h +++ b/firmware/src/os/req_ctx.h @@ -13,11 +13,11 @@ #include <lib_AT91SAM7.h> struct req_ctx { - volatile u_int32_t state; + volatile uint32_t state; volatile struct req_ctx *prev, *next; - u_int16_t size; - u_int16_t tot_len; - u_int8_t *data; + uint16_t size; + uint16_t tot_len; + uint8_t *data; }; #define RCTX_STATE_FREE 0 @@ -45,7 +45,7 @@ extern struct req_ctx __ramfunc *req_ctx_find_get(int large, unsigned long old_s extern struct req_ctx *req_ctx_find_busy(void); extern void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state); extern void req_ctx_put(struct req_ctx *ctx); -extern u_int8_t req_ctx_num(struct req_ctx *ctx); +extern uint8_t req_ctx_num(struct req_ctx *ctx); unsigned int req_ctx_count(unsigned long state); #endif /* _REQ_CTX_H */ diff --git a/firmware/src/os/system_irq.c b/firmware/src/os/system_irq.c index 4c1da31..5f76ea8 100644 --- a/firmware/src/os/system_irq.c +++ b/firmware/src/os/system_irq.c @@ -31,9 +31,9 @@ static sysirq_hdlr *sysirq_hdlrs[AT91SAM7_SYSIRQ_COUNT]; -void sys_irq(u_int32_t previous_pc) +void sys_irq(uint32_t previous_pc) { - u_int32_t sr; + uint32_t sr; /* Somehow Atmel decided to do really stupid interrupt sharing * for commonly-used interrupts such as the timer irq */ diff --git a/firmware/src/os/system_irq.h b/firmware/src/os/system_irq.h index 195b7b9..150c378 100644 --- a/firmware/src/os/system_irq.h +++ b/firmware/src/os/system_irq.h @@ -14,7 +14,7 @@ enum sysirqs { AT91SAM7_SYSIRQ_COUNT }; -typedef void sysirq_hdlr(u_int32_t sr); +typedef void sysirq_hdlr(uint32_t sr); extern void sysirq_register(enum sysirqs irq, sysirq_hdlr *hdlr); extern void sysirq_init(void); diff --git a/firmware/src/os/tc_cdiv.c b/firmware/src/os/tc_cdiv.c index 6f06ba5..bc9d5dd 100644 --- a/firmware/src/os/tc_cdiv.c +++ b/firmware/src/os/tc_cdiv.c @@ -31,7 +31,7 @@ static AT91PS_TCB tcb = AT91C_BASE_TCB; /* set carrier divider to a specific */ -void tc_cdiv_set_divider(u_int16_t div) +void tc_cdiv_set_divider(uint16_t div) { tcb->TCB_TC0.TC_RC = div; diff --git a/firmware/src/os/tc_cdiv.h b/firmware/src/os/tc_cdiv.h index 4f2bc02..86882fb 100644 --- a/firmware/src/os/tc_cdiv.h +++ b/firmware/src/os/tc_cdiv.h @@ -7,7 +7,7 @@ static AT91PS_TCB tcb; extern void tc_cdiv_phase_add(int16_t inc); -extern void tc_cdiv_set_divider(u_int16_t div); +extern void tc_cdiv_set_divider(uint16_t div); static inline void tc_cdiv_phase_inc(void) { diff --git a/firmware/src/os/usb_handler.c b/firmware/src/os/usb_handler.c index 029891a..52abd64 100644 --- a/firmware/src/os/usb_handler.c +++ b/firmware/src/os/usb_handler.c @@ -33,13 +33,13 @@ static usb_cmd_fn *cmd_hdlrs[16]; -int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class) +int usb_hdlr_register(usb_cmd_fn *hdlr, uint8_t class) { cmd_hdlrs[class] = hdlr; return 0; } -void usb_hdlr_unregister(u_int8_t class) +void usb_hdlr_unregister(uint8_t class) { cmd_hdlrs[class] = NULL; } diff --git a/firmware/src/os/usb_handler.h b/firmware/src/os/usb_handler.h index 9d5ad48..52814fd 100644 --- a/firmware/src/os/usb_handler.h +++ b/firmware/src/os/usb_handler.h @@ -18,8 +18,8 @@ enum usbapi_err { typedef int usb_cmd_fn(struct req_ctx *rctx); -extern int usb_hdlr_register(usb_cmd_fn *hdlr, u_int8_t class); -extern void usb_hdlr_unregister(u_int8_t class); +extern int usb_hdlr_register(usb_cmd_fn *hdlr, uint8_t class); +extern void usb_hdlr_unregister(uint8_t class); extern void usb_in_process(void); extern void usb_out_process(void); diff --git a/firmware/src/os/usbcmd_generic.c b/firmware/src/os/usbcmd_generic.c index aff13eb..c76bcc1 100644 --- a/firmware/src/os/usbcmd_generic.c +++ b/firmware/src/os/usbcmd_generic.c @@ -18,14 +18,14 @@ #define OPENPCD_API_VERSION (0x01) #define CONFIG_AREA_ADDR ((void*)(AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE)) -#define CONFIG_AREA_WORDS ( AT91C_IFLASH_PAGE_SIZE/sizeof(u_int32_t) ) +#define CONFIG_AREA_WORDS ( AT91C_IFLASH_PAGE_SIZE/sizeof(uint32_t) ) -volatile u_int32_t config_stack[ CONFIG_AREA_WORDS ]; +volatile uint32_t config_stack[ CONFIG_AREA_WORDS ]; static int gen_setenv(const void* buffer,int len) { volatile unsigned int i; - u_int32_t *dst; + uint32_t *dst; if( len >= sizeof(config_stack) ) len=sizeof(config_stack); @@ -35,7 +35,7 @@ static int gen_setenv(const void* buffer,int len) /* retrieve current content to allow partial flashing */ /* flash changes */ - dst=(u_int32_t*)CONFIG_AREA_ADDR; + dst=(uint32_t*)CONFIG_AREA_ADDR; for(i=0;i<CONFIG_AREA_WORDS;i++) *dst++=config_stack[i]; @@ -59,7 +59,7 @@ static int gen_usb_rx(struct req_ctx *rctx) struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; struct openpcd_compile_version *ver = (struct openpcd_compile_version *)poh->data; - u_int32_t len = rctx->tot_len-sizeof(*poh); + uint32_t len = rctx->tot_len-sizeof(*poh); /* initialize transmit length to header length */ rctx->tot_len = sizeof(*poh); @@ -107,7 +107,7 @@ static int gen_usb_rx(struct req_ctx *rctx) poh->flags |= OPENPCD_FLAG_RESPOND; #ifdef PCD rctx->tot_len += 4; - if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + if (rc632_get_serial(NULL, (uint32_t *)poh->data) < 0) { DEBUGP("ERROR) "); return USB_ERR(USB_ERR_CMD_NOT_IMPL); } diff --git a/firmware/src/os/usbcmd_generic.h b/firmware/src/os/usbcmd_generic.h index 4dd0456..61fbd36 100644 --- a/firmware/src/os/usbcmd_generic.h +++ b/firmware/src/os/usbcmd_generic.h @@ -1,6 +1,6 @@ #ifndef _USBAPI_GENERIC_H #define _USBAPI_GENERIC_H extern void usbcmd_gen_init(void); -extern int gen_setenv(void* data,u_int32_t pos,u_int32_t length); -extern int gen_getenv(void* data,u_int32_t pos,u_int32_t length); +extern int gen_setenv(void* data,uint32_t pos,uint32_t length); +extern int gen_getenv(void* data,uint32_t pos,uint32_t length); #endif diff --git a/firmware/src/os/wdt.c b/firmware/src/os/wdt.c index d5c19a3..6e5248e 100644 --- a/firmware/src/os/wdt.c +++ b/firmware/src/os/wdt.c @@ -30,7 +30,7 @@ #undef WDT_DEBUG #endif/*WDT_DEBUG*/ -static void wdt_irq(u_int32_t sr) +static void wdt_irq(uint32_t sr) { if (sr & 1) AT91F_DBGU_Frame("================> WATCHDOG EXPIRED !!!!!\n\r"); |