mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
Modify the linker script to move some code into flash, enable -mtext-section-literals
This commit is contained in:
@ -17,19 +17,39 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
extern "C" {
|
||||
#include "ets_sys.h"
|
||||
#include "os_type.h"
|
||||
#include "osapi.h"
|
||||
#include "mem.h"
|
||||
#include "user_interface.h"
|
||||
}
|
||||
|
||||
void *operator new(size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void operator delete(void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
|
||||
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
|
||||
|
||||
void __cxa_pure_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
abort();
|
||||
}
|
||||
|
||||
void __cxa_deleted_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#define ARDUINO_MAIN
|
||||
#include "wiring_private.h"
|
||||
#include "pins_arduino.h"
|
||||
#include "c_types.h"
|
||||
#include "eagle_soc.h"
|
||||
#include "gpio.h"
|
||||
|
||||
@ -68,6 +69,12 @@ static const uint32_t g_pin_funcs[PINCOUNT] = {
|
||||
};
|
||||
|
||||
|
||||
enum PinFunction { GPIO, PWM };
|
||||
static uint32_t g_gpio_function[PINCOUNT] = {
|
||||
GPIO
|
||||
};
|
||||
|
||||
|
||||
void pinMode(uint8_t pin, uint8_t mode)
|
||||
{
|
||||
uint32_t mux = g_pin_muxes[pin];
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
extern "C" {
|
||||
#include "ets_sys.h"
|
||||
#include "os_type.h"
|
||||
#include "osapi.h"
|
||||
#include "mem.h"
|
||||
#include "user_interface.h"
|
||||
}
|
||||
|
||||
void *operator new(size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size) {
|
||||
return os_malloc(size);
|
||||
}
|
||||
|
||||
void operator delete(void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr) {
|
||||
os_free(ptr);
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef NEW_H
|
||||
#define NEW_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void * operator new(size_t size);
|
||||
void * operator new[](size_t size);
|
||||
void operator delete(void * ptr);
|
||||
void operator delete[](void * ptr);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user