10000 Fix Updater potential overflow, add host tests by earlephilhower · Pull Request #6954 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Fix Updater potential overflow, add host tests #6954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missed mock file
  • Loading branch information
earlephilhower committed Dec 28, 2019
commit 70ab32e57be86d81083eeb671feb4cfc84224b6e
56 changes: 56 additions & 0 deletions tests/host/common/MockDigital.cpp
423A
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
digital.c - wiring digital implementation for esp8266

Copyright (c) 2015 Hristo Gochkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define ARDUINO_MAIN
#include "wiring_private.h"
#include "pins_arduino.h"
#include "c_types.h"
#include "eagle_soc.h"
#include "ets_sys.h"
#include "user_interface.h"
#include "core_esp8266_waveform.h"
#include "interrupts.h"

extern "C" {

static uint8_t _mode[17];
static uint8_t _gpio[17];

extern void pinMode(uint8_t pin, uint8_t mode) {
if (pin < 17) {
_mode[pin] = mode;
}
}

extern void digitalWrite(uint8_t pin, uint8_t val) {
if (pin < 17) {
_gpio[pin] = val;
}
}

extern int digitalRead(uint8_t pin) {
if (pin < 17) {
return _gpio[pin] != 0;
} else {
return 0;
}
}

};
0