Skip to content

Instantly share code, notes, and snippets.

View a46554's full-sized avatar

RayTsai_tw a46554

View GitHub Profile
// RF Front End Settings
// Note: The use of these values completely depends on how the PCB is laid out.
// Please see Device Package and Evaluation Module (EM) Board below.
#define RF_FE_DIFFERENTIAL 0
#define RF_FE_SINGLE_ENDED_RFP 1
#define RF_FE_SINGLE_ENDED_RFN 2
#define RF_FE_ANT_DIVERSITY_RFP_FIRST 3
#define RF_FE_ANT_DIVERSITY_RFN_FIRST 4
#define RF_FE_SINGLE_ENDED_RFP_EXT_PINS 5
#define RF_FE_SINGLE_ENDED_RFN_EXT_PINS 6
#ifndef USE_DEFAULT_USER_CFG
#include "ble_user_config.h"
// BLE user defined configuration
//bleUserCfg_t user0Cfg = BLE_USER_CFG;
#define MY_RF_FE_MODE_AND_BIAS ( RF_FE_DIFFERENTIAL | RF_FE_INT_BIAS)
package main
import (
"fmt"
"log"
"time"
"golang.org/x/sys/windows/registry"
)
// Copyright 2017 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"log"
"os"
python C:\Python27\Scripts\hexmerge.py -o .\SOMETHING_MERGED.hex -r 0000:1FFFF .\SOMETHING_APP.hex:0000:1FFFF .\SOMETHING_STACK.hex --overlap=error
int 8_t b = -10; // b = 0xf6 for 2's complement
b = b << 1; // b=0xec
b = b >> 1; // Now b = 0x76 and for demical b = 118 unexpect ouput
int 8_t b = -10; // b = 0xf6 for 2's complement
b = b << 1; // b=0xec
b = b >> 1; // Now b = 0x76 and for demical b = 118 unexpect ouput
// The correct way to do that operation
b = b&0x80 | b>>1;// b = 0xf6 for demical b = 10
utils.importFile("../../../../../src/common/cc26xx/kernel/cc2640/config/cc2640.cfg");
/*
* Extend the cc2640 configuration
*/
var SysStd = xdc.useModule("xdc.runtime.SysStd");
var System = xdc.useModule("xdc.runtime.System");
System.SupportProxy = SysStd;
System.extendedFormats = '%$L%$S%$F%f';
import tensorflow as tf
iport numpy as np
from tensorflow import keras
# Create an 1*1 layer neuron
model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])])
# Setting optimizer and loss function
model.compile(optimizer='sgd', loss='mean_squared_error')
# Training data
import tensorflow as tf
# Callback function to check model accuracy
class RayCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs.get('accuracy')>0.99):
print("\nReached 99% accuracy so cancelling training!")
self.model.stop_training = True
# Load the MNIST handwrite digit data set