git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1229 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
cbbe7cce8c
commit
26ed373287
|
@ -125,10 +125,10 @@ AOPT =
|
|||
TOPT = -mthumb -DTHUMB
|
||||
|
||||
# Define C warning options here
|
||||
CWARN = -Wall -Wstrict-prototypes
|
||||
CWARN = -Wall -Wextra -Wstrict-prototypes
|
||||
|
||||
# Define C++ warning options here
|
||||
CPPWARN = -Wall
|
||||
CPPWARN = -Wall -Wextra
|
||||
|
||||
#
|
||||
# Compiler settings
|
||||
|
|
|
@ -25,8 +25,9 @@
|
|||
#include "board.h"
|
||||
|
||||
static WORKING_AREA(waThread1, 64);
|
||||
static msg_t Thread1(void *arg) {
|
||||
static msg_t Thread1(void *p) {
|
||||
|
||||
(void)p;
|
||||
while (TRUE) {
|
||||
palSetPad(IOPORT2, PIOB_LCD_BL);
|
||||
chThdSleepMilliseconds(100);
|
||||
|
@ -41,6 +42,8 @@ static msg_t Thread1(void *arg) {
|
|||
* on entry.
|
||||
*/
|
||||
int main(int argc, char **argv) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
/*
|
||||
* Activates the serial driver 1 using the driver default configuration.
|
||||
|
|
|
@ -139,10 +139,10 @@ AOPT =
|
|||
TOPT = -mthumb -DTHUMB
|
||||
|
||||
# Define C warning options here
|
||||
CWARN = -Wall -Wstrict-prototypes
|
||||
CWARN = -Wall -Wextra -Wstrict-prototypes
|
||||
|
||||
# Define C++ warning options here
|
||||
CPPWARN = -Wall
|
||||
CPPWARN = -Wall -Wextra
|
||||
|
||||
#
|
||||
# Compiler settings
|
||||
|
|
|
@ -146,6 +146,7 @@ struct sys_timeouts *sys_arch_timeouts(void) {
|
|||
|
||||
sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg),
|
||||
void *arg, int stacksize, int prio) {
|
||||
(void)name;
|
||||
size_t wsz = THD_WA_SIZE(stacksize);
|
||||
void *wsp = chCoreAlloc(wsz);
|
||||
if (wsp == NULL)
|
||||
|
@ -161,5 +162,6 @@ sys_prot_t sys_arch_protect(void) {
|
|||
|
||||
void sys_arch_unprotect(sys_prot_t pval) {
|
||||
|
||||
(void)pval;
|
||||
chSysUnlock();
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p) {
|
|||
struct pbuf *q;
|
||||
MACTransmitDescriptor td;
|
||||
|
||||
(void)netif;
|
||||
if (macWaitTransmitDescriptor(Ð1, &td, MS2ST(LWIP_SEND_TIMEOUT)) != RDY_OK)
|
||||
return ERR_TIMEOUT;
|
||||
|
||||
|
@ -138,6 +139,7 @@ static struct pbuf *low_level_input(struct netif *netif) {
|
|||
struct pbuf *p, *q;
|
||||
u16_t len;
|
||||
|
||||
(void)netif;
|
||||
if (macWaitReceiveDescriptor(Ð1, &rd, TIME_IMMEDIATE) == RDY_OK) {
|
||||
len = (u16_t)rd.rd_size;
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
static WORKING_AREA(waThread1, 64);
|
||||
static msg_t Thread1(void *arg) {
|
||||
|
||||
(void)arg;
|
||||
while (TRUE) {
|
||||
palClearPad(IOPORT2, PIOB_LCD_BL);
|
||||
chThdSleepMilliseconds(900);
|
||||
|
@ -44,6 +45,9 @@ static msg_t Thread1(void *arg) {
|
|||
*/
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
/*
|
||||
* Activates the serial driver 1 using the driver default configuration.
|
||||
*/
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
|
||||
#if LWIP_NETCONN
|
||||
|
||||
const static char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n";
|
||||
const static char http_index_html[] = "<html><head><title>Congrats!</title></head><body><h1>Welcome to our lwIP HTTP server!</h1><p>This is a small test page.</body></html>";
|
||||
static const char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n";
|
||||
static const char http_index_html[] = "<html><head><title>Congrats!</title></head><body><h1>Welcome to our lwIP HTTP server!</h1><p>This is a small test page.</body></html>";
|
||||
|
||||
static void http_server_serve(struct netconn *conn) {
|
||||
struct netbuf *inbuf;
|
||||
|
@ -92,6 +92,8 @@ WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE);
|
|||
msg_t http_server(void *p) {
|
||||
struct netconn *conn, *newconn;
|
||||
|
||||
(void)p;
|
||||
|
||||
/* Create a new TCP connection handle */
|
||||
conn = netconn_new(NETCONN_TCP);
|
||||
LWIP_ERROR("http_server: invalid conn", (conn != NULL), return RDY_RESET;);
|
||||
|
|
|
@ -143,10 +143,10 @@ AOPT =
|
|||
TOPT = -mthumb -DTHUMB
|
||||
|
||||
# Define C warning options here
|
||||
CWARN = -Wall -Wstrict-prototypes
|
||||
CWARN = -Wall -Wextra -Wstrict-prototypes
|
||||
|
||||
# Define C++ warning options here
|
||||
CPPWARN = -Wall
|
||||
CPPWARN = -Wall -Wextra
|
||||
|
||||
#
|
||||
# Compiler settings
|
||||
|
|
|
@ -31,6 +31,7 @@ static WORKING_AREA(waThread1, 128);
|
|||
|
||||
static msg_t Thread1(void *arg) {
|
||||
|
||||
(void)arg;
|
||||
while (TRUE) {
|
||||
palSetPad(IOPORT2, PIOB_LCD_BL);
|
||||
chThdSleepMilliseconds(100);
|
||||
|
@ -46,6 +47,9 @@ static msg_t Thread1(void *arg) {
|
|||
*/
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
/*
|
||||
* Activates the serial driver 2 using the driver default configuration.
|
||||
*/
|
||||
|
|
|
@ -88,6 +88,7 @@ clock_time_t clock_time( void )
|
|||
static void PeriodicTimerHandler(eventid_t id) {
|
||||
int i;
|
||||
|
||||
(void)id;
|
||||
for (i = 0; i < UIP_CONNS; i++) {
|
||||
uip_periodic(i);
|
||||
if (uip_len > 0) {
|
||||
|
@ -102,6 +103,7 @@ static void PeriodicTimerHandler(eventid_t id) {
|
|||
*/
|
||||
static void ARPTimerHandler(eventid_t id) {
|
||||
|
||||
(void)id;
|
||||
(void)macPollLinkStatus(Ð1);
|
||||
uip_arp_timer();
|
||||
}
|
||||
|
@ -111,6 +113,7 @@ static void ARPTimerHandler(eventid_t id) {
|
|||
*/
|
||||
static void FrameReceivedHandler(eventid_t id) {
|
||||
|
||||
(void)id;
|
||||
while ((uip_len = network_device_read()) > 0) {
|
||||
if (BUF->type == HTONS(UIP_ETHTYPE_IP)) {
|
||||
uip_arp_ipin();
|
||||
|
@ -143,6 +146,8 @@ msg_t WebThread(void *p) {
|
|||
EventListener el0, el1, el2;
|
||||
uip_ipaddr_t ipaddr;
|
||||
|
||||
(void)p;
|
||||
|
||||
/*
|
||||
* Event sources setup.
|
||||
*/
|
||||
|
|
|
@ -204,6 +204,7 @@ void mac_lld_init(void) {
|
|||
*/
|
||||
void mac_lld_set_address(MACDriver *macp, const uint8_t *p) {
|
||||
|
||||
(void)macp;
|
||||
AT91C_BASE_EMAC->EMAC_SA1L = (AT91_REG)((p[3] << 24) | (p[2] << 16) |
|
||||
(p[1] << 8) | p[0]);
|
||||
AT91C_BASE_EMAC->EMAC_SA1H = (AT91_REG)((p[5] << 8) | p[4]);
|
||||
|
@ -224,6 +225,8 @@ msg_t max_lld_get_transmit_descriptor(MACDriver *macp,
|
|||
MACTransmitDescriptor *tdp) {
|
||||
EMACDescriptor *edp;
|
||||
|
||||
(void)macp;
|
||||
|
||||
if (!link_up)
|
||||
return RDY_TIMEOUT;
|
||||
|
||||
|
@ -318,6 +321,7 @@ msg_t max_lld_get_receive_descriptor(MACDriver *macp,
|
|||
unsigned n;
|
||||
EMACDescriptor *edp;
|
||||
|
||||
(void)macp;
|
||||
n = EMAC_RECEIVE_DESCRIPTORS;
|
||||
|
||||
/*
|
||||
|
|
|
@ -42,6 +42,8 @@ void mii_lld_init(void) {
|
|||
*/
|
||||
void mii_lld_reset(MACDriver *macp) {
|
||||
|
||||
(void)macp;
|
||||
|
||||
/*
|
||||
* Disables the pullups on all the pins that are latched on reset by the PHY.
|
||||
* The status latched into the PHY is:
|
||||
|
@ -87,6 +89,7 @@ void mii_lld_reset(MACDriver *macp) {
|
|||
*/
|
||||
phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) {
|
||||
|
||||
(void)macp;
|
||||
AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */
|
||||
(0b10 << 28) | /* RW */
|
||||
(PHY_ADDRESS << 23) | /* PHYA */
|
||||
|
@ -106,6 +109,7 @@ phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) {
|
|||
*/
|
||||
void mii_lld_put(MACDriver *macp, phyaddr_t addr, phyreg_t value) {
|
||||
|
||||
(void)macp;
|
||||
AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */
|
||||
(0b01 << 28) | /* RW */
|
||||
(PHY_ADDRESS << 23) | /* PHYA */
|
||||
|
|
|
@ -56,7 +56,11 @@ typedef struct {
|
|||
* @param name the name of the memory pool variable
|
||||
* @param size size of the memory pool contained objects
|
||||
*/
|
||||
#define _MEMORYPOOL_DATA(name, size) {NULL, size}
|
||||
#if CH_USE_MEMCORE || defined(__DOXYGEN__)
|
||||
#define _MEMORYPOOL_DATA(name, size) {NULL, MEM_ALIGN_SIZE(size), FALSE}
|
||||
#else
|
||||
#define _MEMORYPOOL_DATA(name, size) {NULL, MEM_ALIGN_SIZE(size)}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Static memory pool initializer.
|
||||
|
|
|
@ -40,6 +40,7 @@ static WORKING_AREA(idle_thread_wa, IDLE_THREAD_STACK_SIZE);
|
|||
*/
|
||||
static void idle_thread(void *p) {
|
||||
|
||||
(void)p;
|
||||
while (TRUE) {
|
||||
port_wait_for_interrupt();
|
||||
IDLE_LOOP_HOOK();
|
||||
|
|
|
@ -211,6 +211,7 @@ static VirtualTimer vt;
|
|||
bool_t test_timer_done;
|
||||
|
||||
static void tmr(void *p) {
|
||||
(void)p;
|
||||
|
||||
test_timer_done = TRUE;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ static Mutex mtx1;
|
|||
static msg_t thread1(void *p) {
|
||||
msg_t msg;
|
||||
|
||||
(void)p;
|
||||
do {
|
||||
chMsgRelease(msg = chMsgWait());
|
||||
} while (msg);
|
||||
|
@ -223,6 +224,7 @@ msg_t thread4(void *p) {
|
|||
msg_t msg;
|
||||
Thread *self = chThdSelf();
|
||||
|
||||
(void)p;
|
||||
chSysLock();
|
||||
do {
|
||||
chSchGoSleepS(PRSUSPENDED);
|
||||
|
@ -367,6 +369,7 @@ const struct testcase testbmk6 = {
|
|||
|
||||
static msg_t thread3(void *p) {
|
||||
|
||||
(void)p;
|
||||
while (!chThdShouldTerminate())
|
||||
chSemWait(&sem1);
|
||||
return 0;
|
||||
|
@ -544,7 +547,7 @@ static char *bmk10_gettest(void) {
|
|||
return "Benchmark, virtual timers set/reset";
|
||||
}
|
||||
|
||||
static void tmo(void *param) {}
|
||||
static void tmo(void *param) {(void)param;}
|
||||
|
||||
static void bmk10_execute(void) {
|
||||
static VirtualTimer vt1, vt2;
|
||||
|
|
|
@ -84,9 +84,9 @@ static void evt1_setup(void) {
|
|||
chEvtClear(ALL_EVENTS);
|
||||
}
|
||||
|
||||
static void h1(eventid_t id) {test_emit_token('A');}
|
||||
static void h2(eventid_t id) {test_emit_token('B');}
|
||||
static void h3(eventid_t id) {test_emit_token('C');}
|
||||
static void h1(eventid_t id) {(void)id;test_emit_token('A');}
|
||||
static void h2(eventid_t id) {(void)id;test_emit_token('B');}
|
||||
static void h3(eventid_t id) {(void)id;test_emit_token('C');}
|
||||
static const evhandler_t evhndl[] = {h1, h2, h3};
|
||||
|
||||
static void evt1_execute(void) {
|
||||
|
@ -151,6 +151,7 @@ static msg_t thread1(void *p) {
|
|||
|
||||
static msg_t thread2(void *p) {
|
||||
|
||||
(void)p;
|
||||
chEvtBroadcast(&es1);
|
||||
chThdSleepMilliseconds(50);
|
||||
chEvtBroadcast(&es2);
|
||||
|
|
|
@ -165,6 +165,7 @@ static void mtx2_setup(void) {
|
|||
/* Low priority thread */
|
||||
static msg_t thread2L(void *p) {
|
||||
|
||||
(void)p;
|
||||
chMtxLock(&m1);
|
||||
test_cpu_pulse(40);
|
||||
chMtxUnlock();
|
||||
|
@ -176,6 +177,7 @@ static msg_t thread2L(void *p) {
|
|||
/* Medium priority thread */
|
||||
static msg_t thread2M(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(20);
|
||||
test_cpu_pulse(40);
|
||||
test_emit_token('B');
|
||||
|
@ -185,6 +187,7 @@ static msg_t thread2M(void *p) {
|
|||
/* High priority thread */
|
||||
static msg_t thread2H(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(40);
|
||||
chMtxLock(&m1);
|
||||
test_cpu_pulse(10);
|
||||
|
@ -257,6 +260,7 @@ static void mtx3_setup(void) {
|
|||
/* Lowest priority thread */
|
||||
static msg_t thread3LL(void *p) {
|
||||
|
||||
(void)p;
|
||||
chMtxLock(&m1);
|
||||
test_cpu_pulse(30);
|
||||
chMtxUnlock();
|
||||
|
@ -267,6 +271,7 @@ static msg_t thread3LL(void *p) {
|
|||
/* Low priority thread */
|
||||
static msg_t thread3L(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(10);
|
||||
chMtxLock(&m2);
|
||||
test_cpu_pulse(20);
|
||||
|
@ -282,6 +287,7 @@ static msg_t thread3L(void *p) {
|
|||
/* Medium priority thread */
|
||||
static msg_t thread3M(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(20);
|
||||
chMtxLock(&m2);
|
||||
test_cpu_pulse(10);
|
||||
|
@ -293,6 +299,7 @@ static msg_t thread3M(void *p) {
|
|||
/* High priority thread */
|
||||
static msg_t thread3H(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(40);
|
||||
test_cpu_pulse(20);
|
||||
test_emit_token('B');
|
||||
|
@ -302,6 +309,7 @@ static msg_t thread3H(void *p) {
|
|||
/* Highest priority thread */
|
||||
static msg_t thread3HH(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(50);
|
||||
chMtxLock(&m2);
|
||||
test_cpu_pulse(10);
|
||||
|
@ -355,6 +363,7 @@ static void mtx4_setup(void) {
|
|||
|
||||
static msg_t thread4a(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(50);
|
||||
chMtxLock(&m2);
|
||||
chMtxUnlock();
|
||||
|
@ -363,6 +372,7 @@ static msg_t thread4a(void *p) {
|
|||
|
||||
static msg_t thread4b(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(150);
|
||||
chMtxLock(&m1);
|
||||
chMtxUnlock();
|
||||
|
|
|
@ -135,6 +135,7 @@ static void sem2_setup(void) {
|
|||
|
||||
static msg_t thread2(void *p) {
|
||||
|
||||
(void)p;
|
||||
chThdSleepMilliseconds(50);
|
||||
chSysLock();
|
||||
chSemSignalI(&sem1); /* For coverage reasons */
|
||||
|
@ -215,6 +216,7 @@ static void sem3_setup(void) {
|
|||
|
||||
static msg_t thread3(void *p) {
|
||||
|
||||
(void)p;
|
||||
chSemWait(&sem1);
|
||||
chSemSignal(&sem1);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue