mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 07:10:43 -04:00
Tease apart utility.hpp, other header dependencies.
Trying to get a host-testable FSK demodulator, and finding a lot of M4- and ChibiOS-specific code is getting included. Boo.
This commit is contained in:
parent
e049097f49
commit
f82fd1f8d7
13 changed files with 135 additions and 64 deletions
|
@ -19,8 +19,6 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <ch.h>
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
@ -115,22 +113,3 @@ static constexpr uint32_t gcd_top(const uint32_t u, const uint32_t v) {
|
|||
uint32_t gcd(const uint32_t u, const uint32_t v) {
|
||||
return gcd_top(u, v);
|
||||
}
|
||||
|
||||
/* Memory management, overriding toolchain new, which uses malloc */
|
||||
/* TODO: Move to something like "memory.cpp"! Not utility.cpp. */
|
||||
|
||||
void* operator new(size_t size) {
|
||||
return chHeapAlloc(0x0, size);
|
||||
}
|
||||
|
||||
void* operator new[](size_t size) {
|
||||
return chHeapAlloc(0x0, size);
|
||||
}
|
||||
|
||||
void operator delete(void* p) noexcept {
|
||||
chHeapFree(p);
|
||||
}
|
||||
|
||||
void operator delete[](void* p) noexcept {
|
||||
chHeapFree(p);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue