Browse Source

* Allow COPTIM to be set outside Makefile

* Use -Wall -Werror
* Fix some warnings
master
Gavan Fantom 14 years ago
parent
commit
4d37c82b12
  1. 3
      Makefile
  2. 4
      i2c.c
  3. 4
      i2c.h
  4. 1
      main.c
  5. 1
      wmp.c

3
Makefile

@ -5,7 +5,8 @@ NAME=quad
SSRCS=crt0.s
CSRCS=main.c i2c.c wmp.c timer.c
CFLAGS=-march=armv4t -msoft-float -O1
COPTIM?=-O1
CFLAGS=-march=armv4t -msoft-float $(COPTIM) -Wall -Werror
LDSCRIPT=lpc2103_flash.ld
CC=arm-elf-gcc

4
i2c.c

@ -79,7 +79,7 @@ bool i2c_send_address(int addr, bool write)
return i2c_send_data((addr<<1) + (write?0:1));
}
bool i2c_send_data(int data)
bool i2c_send_data(unsigned int data)
{
IREG(I2DAT) = data;
IREG(I2CONCLR) = STAFLAG | STOFLAG | SIFLAG;
@ -94,7 +94,7 @@ bool i2c_send_data(int data)
}
}
bool i2c_receive_data(int *data, bool last)
bool i2c_receive_data(unsigned int *data, bool last)
{
if (!last)
IREG(I2CONSET) = AAFLAG;

4
i2c.h

@ -10,8 +10,8 @@ int i2c_conreg(void);
int i2c_statreg(void);
bool i2c_send_start(void);
bool i2c_send_address(int addr, bool write);
bool i2c_send_data(int data);
bool i2c_receive_data(int *data, bool last);
bool i2c_send_data(unsigned int data);
bool i2c_receive_data(unsigned int *data, bool last);
void i2c_send_stop(void);
#endif /* __I2C_H */

1
main.c

@ -228,7 +228,6 @@ void average_sample(void)
int main(void) {
int i;
int data;
init_uart();
init_i2c();
init_pins();

1
wmp.c

@ -13,6 +13,7 @@ bool wmp_init(void)
if (!i2c_send_data(0x04))
return FALSE;
i2c_send_stop();
return TRUE;
}
unsigned char wmp_calibration_data[0x20];

Loading…
Cancel
Save