Skip to content

Instantly share code, notes, and snippets.

View drewandre's full-sized avatar

Drew André drewandre

View GitHub Profile
#import <React/RCTBridgeModule.h>
#import <HomeKit/HomeKit.h>
#import "React/RCTEventEmitter.h"
@interface RCT_EXTERN_MODULE(HomeKitModule, RCTEventEmitter)
RCT_EXTERN_METHOD(listHomes: (NSString *)name withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
RCT_EXTERN_METHOD(addAndSetupAccessories: (NSString *)name withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
@drewandre
drewandre / Pagination.js
Last active December 30, 2022 08:48
Pagination component for use with react-native-snap-carousel
import React from 'react'
import { StyleSheet } from 'react-native'
import Animated, {
Extrapolate,
interpolate,
useAnimatedStyle
} from 'react-native-reanimated'
import { colors, metrics } from 'styles';
function clamp(value, lowerBound, upperBound) {
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 16989, TID: 8855492, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 Reanimated2Playground 0x000000010dba5b1c _ZN10reanimated22createReanimatedModuleENSt3__110shared_ptrIN8facebook5react11CallInvokerEEE + 140
5 Reanimated2Playground 0x000000010dbe280c _ZN8facebook5react21RETurboModuleProviderERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_10shared_ptrINS0_11CallInvokerEEE + 92
6 Reanimated2Playground 0x000000010d6ad31b -[AppDelegate getTurboModule:jsInvoker:] + 75
7 Reanimated2Playground 0x000000010def4ae8 -[RCTTurboModuleManager provideTurboModule:] + 456
8 Reanimated2Playground 0x000000010defcd27 _ZZ49-[RCTTurboModuleManager initWithBridge:delegate:]ENK3$_0clERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 455
9 Reanimated2Playgr
float map(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
I (92535) view: Data min[696] = -inf, Data max[328] = 26.511551
________________________________________________________________________________________________________________________________
0 |
1 |
2 || |
3 || |
4 || |
5 || |
6 ||
I (31804) view: Data min[899] = -91.273849, Data max[461] = 15.370447
________________________________________________________________________________________________________________________________
0 |
1 |
2 |
3 |
4 | | |
5 || | | | | | | | | | | | | |
6 | | || | | | | | || |
float input_buf[4096] = {
-0.749020,
0.019608,
-0.168627,
0.945098,
0.560784,
-0.270588,
0.898039,
0.882353,
-0.984314,
Flashing binaries to serial port /dev/cu.SLAB_USBtoUART (app at offset 0x160000)...
esptool.py v2.8
Serial port /dev/cu.SLAB_USBtoUART
Connecting......
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: bc:dd:c2:d1:d2:7c
Uploading stub...
Running stub...
rst:0x3 (SW_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6808
load:0x40078000,len:12072
load:0x40080400,len:6708
entry 0x40080778
I (108) boot: Chip Revision: 1
I (15626) wifi: bcn_timout,ap_probe_send_start
Update: palette_firmware.bin
Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0xffffffff PS : 0x00060230 A0 : 0x8009449c A1 : 0x3ffda010
A2 : 0x3ffbdf54 A3 : 0x3ffbe488 A4 : 0x00000000 A5 : 0x3ffd1e30
A6 : 0x0000001a A7 : 0x3ffbe1e4 A8 : 0xffffffff A9 : 0x3ffd9ff0
A10 : 0x0000000b A11 : 0x00000000 A12 : 0x400817fc A13 : 0x400ea138
0x400817fc: wifi_int_restore_wrapper at /Users/drewandre/esp/esp-adf/esp-idf/components/esp32/esp_adapter.c:201