Skip to content

Commit b9b8f01

Browse files
author
Stefan Kremser
committed
Fixing imports for ESP8266
1 parent e0e5c47 commit b9b8f01

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/PCAP.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void PCAP::startSerial(){
1515
serialwrite_32(network);
1616
}
1717

18-
#if defined(ESP32) || defined(__XTENSA__)
18+
#if defined(ESP32)
1919
/* open file on SD card (when exists) */
2020
bool PCAP::openFile(fs::FS &fs){
2121
if(fs.exists(filename.c_str())) removeFile(fs);
@@ -76,8 +76,10 @@ void PCAP::closeFile(){
7676
void PCAP::newPacketSerial(uint32_t ts_sec, uint32_t ts_usec, uint32_t len, uint8_t* buf){
7777
uint32_t orig_len = len;
7878
uint32_t incl_len = len;
79-
//if(incl_len > snaplen) incl_len = snaplen; /* safty check that the packet isn't too big (I ran into problems here) */
80-
79+
80+
#if defined(ESP32)
81+
if(incl_len > snaplen) incl_len = snaplen; /* safty check that the packet isn't too big (I ran into problems with the ESP8266 here) */
82+
#endif
8183
serialwrite_32(ts_sec);
8284
serialwrite_32(ts_usec);
8385
serialwrite_32(incl_len);

src/PCAP.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#define PCAP_h
1010

1111
#include <Arduino.h>
12-
#if defined(ESP32) || defined(__XTENSA__)
12+
#include "SPI.h"
13+
#if defined(ESP32)
1314
#include "FS.h"
1415
#include "SD.h"
15-
#include "SPI.h"
1616
#else
1717
#include <SPI.h>
1818
#include <SdFat.h>
@@ -24,7 +24,7 @@ class PCAP
2424
PCAP();
2525

2626
void startSerial();
27-
#if defined(ESP32) || defined(__XTENSA__)
27+
#if defined(ESP32)
2828
bool openFile(fs::FS &fs);
2929
bool removeFile(fs::FS &fs);
3030
#else

0 commit comments

Comments
 (0)