Convert W6300 #defines to constexpr/inline across all headers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "socket.h"
|
||||
|
||||
#define SOCK_ANY_PORT_NUM 0xC000
|
||||
constexpr uint16_t SOCK_ANY_PORT_NUM = 0xC000;
|
||||
|
||||
static uint16_t sock_any_port = SOCK_ANY_PORT_NUM;
|
||||
static uint16_t sock_io_mode = 0;
|
||||
@@ -18,15 +18,6 @@ uint8_t sock_pack_info[_WIZCHIP_SOCK_NUM_] = {0,};
|
||||
#define CHECK_SOCKDATA() do { if(len == 0) return SOCKERR_DATALEN; } while(0)
|
||||
#define CHECK_IPZERO(addr, addrlen) do { uint16_t ipzero=0; for(uint8_t i=0; i<addrlen; i++) ipzero += (uint16_t)addr[i]; if(ipzero == 0) return SOCKERR_IPINVALID; } while(0)
|
||||
|
||||
#define Sn_MR_TCP4 (Sn_MR_TCP)
|
||||
#define Sn_MR_UDP4 (Sn_MR_UDP)
|
||||
#define Sn_MR_IPRAW4 (Sn_MR_IPRAW)
|
||||
#define Sn_MR_TCP6 (0x09)
|
||||
#define Sn_MR_UDP6 (0x0A)
|
||||
#define Sn_MR_IPRAW6 (0x0B)
|
||||
#define Sn_MR_TCPD (0x0D)
|
||||
#define Sn_MR_UDPD (0x0E)
|
||||
|
||||
int8_t socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag) {
|
||||
uint8_t taddr[16];
|
||||
CHECK_SOCKNUM();
|
||||
|
||||
Reference in New Issue
Block a user