mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-20 11:19:56 +00:00
Kill ARP cache, kill qprofile
This commit is contained in:
1 parent
1c749a5310
commit
9dc86aa77d
26 files changed
+674
-988
No files matched your search
@@ -32,7 +32,7 @@ static void ethernet_init(void) {
|
||||
GPIO_PULL_NONE, 5); // EN0LED1
|
||||
gpio_init(LED4, GPIO_MODE_AF, GPIO_OTYPE_PUSH_PULL, GPIO_SPEED_HIGH,
|
||||
GPIO_PULL_NONE, 5); // EN0LED0
|
||||
nvic_enable_irq(40); // Setup Ethernet IRQ handler
|
||||
nvic_enable_irq(40); // Setup Ethernet IRQ handler
|
||||
// Initialize Ethernet clocks, see datasheet section 5
|
||||
// Turn Flash Prefetch off (silicon errata ETH#02)
|
||||
volatile uint32_t *IMC = (uint32_t *) 0x400FD000;
|
||||
@@ -85,15 +85,15 @@ static void blinker(void *args) {
|
||||
for (;;) {
|
||||
gpio_toggle(LED1);
|
||||
vTaskDelay(pdMS_TO_TICKS(750));
|
||||
(void)args;//MG_INFO(("blink %s, RAM: %u", (char *) args, xPortGetFreeHeapSize()));
|
||||
(void) args; // MG_INFO(("blink %s, RAM: %u", (char *) args,
|
||||
// xPortGetFreeHeapSize()));
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
static struct uart *uart = UART0; // Use UART0 (attached to ICDI)
|
||||
clock_init(); // Set clock to 120MHz
|
||||
systick_init(FREQ / 1000); // Tick every 1 ms
|
||||
uart_init(uart, 115200); // Initialise UART
|
||||
clock_init(); // Set clock to 120MHz
|
||||
systick_init(FREQ / 1000); // Tick every 1 ms
|
||||
uart_init(UART_DEBUG, 115200); // Initialise UART
|
||||
xTaskCreate(blinker, "blinker", 128, ":)", configMAX_PRIORITIES - 1, NULL);
|
||||
xTaskCreate(server, "server", 2048, 0, configMAX_PRIORITIES - 1, NULL);
|
||||
vTaskStartScheduler(); // This blocks
|
||||
|
||||
@@ -190,6 +190,10 @@ struct uart {
|
||||
|
||||
#define UART0 USART(0)
|
||||
|
||||
#ifndef UART_DEBUG
|
||||
#define UART_DEBUG UART0
|
||||
#endif
|
||||
|
||||
static inline void uart_init(struct uart *uart, unsigned long baud) {
|
||||
struct uarthw {
|
||||
uint16_t rx, tx; // pins
|
||||
|
||||
@@ -8,12 +8,6 @@ int _fstat(int fd, struct stat *st) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _write(int fd, char *ptr, int len) {
|
||||
(void) fd, (void) ptr, (void) len;
|
||||
if (fd == 1) uart_write_buf(UART0, ptr, (size_t) len);
|
||||
return len;
|
||||
}
|
||||
|
||||
void *_sbrk(int incr) {
|
||||
extern char _end;
|
||||
static unsigned char *heap = NULL;
|
||||
@@ -24,6 +18,11 @@ void *_sbrk(int incr) {
|
||||
return prev_heap;
|
||||
}
|
||||
|
||||
int _open(const char *path) {
|
||||
(void) path;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _close(int fd) {
|
||||
(void) fd;
|
||||
return -1;
|
||||
@@ -34,12 +33,53 @@ int _isatty(int fd) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _lseek(int fd, int ptr, int dir) {
|
||||
(void) fd, (void) ptr, (void) dir;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _exit(int status) {
|
||||
(void) status;
|
||||
for (;;) asm volatile("BKPT #0");
|
||||
}
|
||||
|
||||
void _kill(int pid, int sig) {
|
||||
(void) pid, (void) sig;
|
||||
}
|
||||
|
||||
int _getpid(void) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _write(int fd, char *ptr, int len) {
|
||||
(void) fd, (void) ptr, (void) len;
|
||||
if (fd == 1) uart_write_buf(UART_DEBUG, ptr, (size_t) len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _read(int fd, char *ptr, int len) {
|
||||
(void) fd, (void) ptr, (void) len;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _lseek(int fd, int ptr, int dir) {
|
||||
(void) fd, (void) ptr, (void) dir;
|
||||
return 0;
|
||||
int _link(const char *a, const char *b) {
|
||||
(void) a, (void) b;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _unlink(const char *a) {
|
||||
(void) a;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _stat(const char *path, struct stat *st) {
|
||||
(void) path, (void) st;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int mkdir(const char *path, mode_t mode) {
|
||||
(void) path, (void) mode;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void _init(void) {}
|
||||
Reference in new issue
Block a user