From 8edf8c2d4f47dc9548b3d06c7b4248aa57267010 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 10 Apr 2026 21:51:58 +0900 Subject: [PATCH] Remove unused iodata_t, PIO_OFFSET_WRITE_BITS, trim intr_kind, move sock_count to cpp --- firmware/w6300/w6300.cpp | 5 +++-- firmware/w6300/w6300.h | 11 +---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/firmware/w6300/w6300.cpp b/firmware/w6300/w6300.cpp index 21404ab..f13a950 100644 --- a/firmware/w6300/w6300.cpp +++ b/firmware/w6300/w6300.cpp @@ -8,12 +8,14 @@ #include "qspi.pio.h" namespace w6300 { + +constexpr int sock_count = 8; + namespace { #define PIO_PROGRAM_NAME qspi #define PIO_PROGRAM_FUNC __CONCAT(PIO_PROGRAM_NAME, _program) #define PIO_PROGRAM_GET_DEFAULT_CONFIG_FUNC __CONCAT(PIO_PROGRAM_NAME, _program_get_default_config) -#define PIO_OFFSET_WRITE_BITS __CONCAT(PIO_PROGRAM_NAME, _offset_write_bits) #define PIO_OFFSET_WRITE_BITS_END __CONCAT(PIO_PROGRAM_NAME, _offset_write_bits_end) #define PIO_OFFSET_READ_BITS_END __CONCAT(PIO_PROGRAM_NAME, _offset_read_bits_end) @@ -225,7 +227,6 @@ void pio_write(uint8_t opcode, uint16_t addr, uint8_t* buf, uint16_t len) { pio_sm_set_enabled(state.pio, state.pio_sm, false); } -using iodata_t = uint8_t; using datasize_t = int16_t; diff --git a/firmware/w6300/w6300.h b/firmware/w6300/w6300.h index 556a324..1976ceb 100644 --- a/firmware/w6300/w6300.h +++ b/firmware/w6300/w6300.h @@ -6,8 +6,6 @@ namespace w6300 { -constexpr int sock_count = 8; - enum class socket_id : uint8_t {}; enum class sock_error : int16_t { @@ -30,14 +28,7 @@ enum class sock_flag : uint8_t { }; enum intr_kind : uint32_t { - ik_pppoe_terminated = (1 << 0), ik_dest_unreach = (1 << 1), ik_ip_conflict = (1 << 2), - ik_dest_unreach6 = (1 << 4), ik_wol = (1 << 7), ik_net_all = 0x97, - ik_sock_0 = (1 << 8), ik_sock_1 = (1 << 9), ik_sock_2 = (1 << 10), ik_sock_3 = (1 << 11), - ik_sock_4 = (1 << 12), ik_sock_5 = (1 << 13), ik_sock_6 = (1 << 14), ik_sock_7 = (1 << 15), - ik_sock_all = (0xFF << 8), - ik_sockl_tout = (1 << 16), ik_sockl_arp4 = (1 << 17), ik_sockl_ping4 = (1 << 18), - ik_sockl_arp6 = (1 << 19), ik_sockl_ping6 = (1 << 20), ik_sockl_ns = (1 << 21), - ik_sockl_rs = (1 << 22), ik_sockl_ra = (1 << 23), ik_sockl_all = (0xFF << 16), + ik_sock_0 = (1 << 8), ik_int_all = 0x00FFFF97 };