mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-27 12:49:01 +08:00
Adopt CCRH compiler
This commit is contained in:
parent
01ae80ecd1
commit
112a1e908a
@ -664,7 +664,7 @@ MG_IRAM bool mg_flash_erase(void *addr) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
MG_IRAM bool mg_flash_swap_bank() {
|
||||
MG_IRAM bool mg_flash_swap_bank(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1007,7 +1007,7 @@ MG_IRAM bool mg_flash_erase(void *addr) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
MG_IRAM bool mg_flash_swap_bank() {
|
||||
MG_IRAM bool mg_flash_swap_bank(void) {
|
||||
if (mg_flash_bank() == 0) return true;
|
||||
uint32_t bank = FLASH_BASE1;
|
||||
uint32_t desired = flash_bank_is_swapped(bank) ? 0 : MG_BIT(31);
|
||||
|
12
mongoose.h
12
mongoose.h
@ -1055,9 +1055,9 @@ uint64_t mg_now(void); // Return milliseconds since Epoch
|
||||
#define mg_htons(x) mg_ntohs(x)
|
||||
#define mg_htonl(x) mg_ntohl(x)
|
||||
|
||||
#define MG_U32(a, b, c, d) \
|
||||
(((uint32_t) ((a) &255) << 24) | ((uint32_t) ((b) &255) << 16) | \
|
||||
((uint32_t) ((c) &255) << 8) | (uint32_t) ((d) &255))
|
||||
#define MG_U32(a, b, c, d) \
|
||||
(((uint32_t) ((a) & 255) << 24) | ((uint32_t) ((b) & 255) << 16) | \
|
||||
((uint32_t) ((c) & 255) << 8) | (uint32_t) ((d) & 255))
|
||||
|
||||
// For printing IPv4 addresses: printf("%d.%d.%d.%d\n", MG_IPADDR_PARTS(&ip))
|
||||
#define MG_U8P(ADDR) ((uint8_t *) (ADDR))
|
||||
@ -1071,9 +1071,12 @@ uint64_t mg_now(void); // Return milliseconds since Epoch
|
||||
#define MG_ROUND_UP(x, a) ((a) == 0 ? (x) : ((((x) + (a) -1) / (a)) * (a)))
|
||||
#define MG_ROUND_DOWN(x, a) ((a) == 0 ? (x) : (((x) / (a)) * (a)))
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__)
|
||||
#define MG_ARM_DISABLE_IRQ() asm volatile("cpsid i" : : : "memory")
|
||||
#define MG_ARM_ENABLE_IRQ() asm volatile("cpsie i" : : : "memory")
|
||||
#elif defined(__CCRH__)
|
||||
#define MG_RH850_DISABLE_IRQ() __DI()
|
||||
#define MG_RH850_ENABLE_IRQ() __EI()
|
||||
#else
|
||||
#define MG_ARM_DISABLE_IRQ()
|
||||
#define MG_ARM_ENABLE_IRQ()
|
||||
@ -2676,6 +2679,7 @@ MG_IRAM void mg_ota_boot(void); // Bootloader function
|
||||
#define MG_DEVICE_RT1020 3 // IMXRT1020
|
||||
#define MG_DEVICE_RT1060 4 // IMXRT1060
|
||||
#define MG_DEVICE_CH32V307 100 // WCH CH32V307
|
||||
#define MG_DEVICE_U2A 200 // Renesas U2A16, U2A8, U2A6
|
||||
#define MG_DEVICE_CUSTOM 1000 // Custom implementation
|
||||
|
||||
#ifndef MG_DEVICE
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define MG_DEVICE_RT1020 3 // IMXRT1020
|
||||
#define MG_DEVICE_RT1060 4 // IMXRT1060
|
||||
#define MG_DEVICE_CH32V307 100 // WCH CH32V307
|
||||
#define MG_DEVICE_U2A 200 // Renesas U2A16, U2A8, U2A6
|
||||
#define MG_DEVICE_CUSTOM 1000 // Custom implementation
|
||||
|
||||
#ifndef MG_DEVICE
|
||||
|
@ -249,7 +249,7 @@ MG_IRAM bool mg_flash_erase(void *addr) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
MG_IRAM bool mg_flash_swap_bank() {
|
||||
MG_IRAM bool mg_flash_swap_bank(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ MG_IRAM bool mg_flash_erase(void *addr) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
MG_IRAM bool mg_flash_swap_bank() {
|
||||
MG_IRAM bool mg_flash_swap_bank(void) {
|
||||
if (mg_flash_bank() == 0) return true;
|
||||
uint32_t bank = FLASH_BASE1;
|
||||
uint32_t desired = flash_bank_is_swapped(bank) ? 0 : MG_BIT(31);
|
||||
|
11
src/util.h
11
src/util.h
@ -23,9 +23,9 @@ uint64_t mg_now(void); // Return milliseconds since Epoch
|
||||
#define mg_htons(x) mg_ntohs(x)
|
||||
#define mg_htonl(x) mg_ntohl(x)
|
||||
|
||||
#define MG_U32(a, b, c, d) \
|
||||
(((uint32_t) ((a) &255) << 24) | ((uint32_t) ((b) &255) << 16) | \
|
||||
((uint32_t) ((c) &255) << 8) | (uint32_t) ((d) &255))
|
||||
#define MG_U32(a, b, c, d) \
|
||||
(((uint32_t) ((a) & 255) << 24) | ((uint32_t) ((b) & 255) << 16) | \
|
||||
((uint32_t) ((c) & 255) << 8) | (uint32_t) ((d) & 255))
|
||||
|
||||
// For printing IPv4 addresses: printf("%d.%d.%d.%d\n", MG_IPADDR_PARTS(&ip))
|
||||
#define MG_U8P(ADDR) ((uint8_t *) (ADDR))
|
||||
@ -39,9 +39,12 @@ uint64_t mg_now(void); // Return milliseconds since Epoch
|
||||
#define MG_ROUND_UP(x, a) ((a) == 0 ? (x) : ((((x) + (a) -1) / (a)) * (a)))
|
||||
#define MG_ROUND_DOWN(x, a) ((a) == 0 ? (x) : (((x) / (a)) * (a)))
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__)
|
||||
#define MG_ARM_DISABLE_IRQ() asm volatile("cpsid i" : : : "memory")
|
||||
#define MG_ARM_ENABLE_IRQ() asm volatile("cpsie i" : : : "memory")
|
||||
#elif defined(__CCRH__)
|
||||
#define MG_RH850_DISABLE_IRQ() __DI()
|
||||
#define MG_RH850_ENABLE_IRQ() __EI()
|
||||
#else
|
||||
#define MG_ARM_DISABLE_IRQ()
|
||||
#define MG_ARM_ENABLE_IRQ()
|
||||
|
Loading…
Reference in New Issue
Block a user