Skip to content

Instantly share code, notes, and snippets.

View CyberCircuits's full-sized avatar

Harold J Tarun CyberCircuits

View GitHub Profile
@CyberCircuits
CyberCircuits / microtime.c
Last active September 1, 2015 10:16
Get the current time in microseconds in C.
#include <sys/time.h>
/**
* Returns the current time in microseconds.
*/
long getMicrotime(){
struct timeval currentTime;
gettimeofday(&currentTime, NULL);
return currentTime.tv_sec * (int)1e6 + currentTime.tv_usec;
}
@CyberCircuits
CyberCircuits / main.c
Created February 8, 2016 20:12 — forked from ossicode/main.c
MSP430 I2C and UART at the same time from ti forum written by Brandon Elliott
//******************************************************************************
// MSP430xG461x Demo - USCI_A0 UART TX single byte and USCI_B0 I2C Master TX
// single byte to MSP430 Slave
//
// Description: This demo connects two MSP430's via the I2C bus and UART.
// The master transmits to the slave. This is the master code. It continuously
// transmits a single byte of data starting at 0 and incrementing from both
// UART and I2C. This demonstrates how to implement an I2C master transmitter
// using the USCI_B0 TX interrupt and UART transmission using the USCI_A0 TX
// interrupt simultaneously.
@CyberCircuits
CyberCircuits / delay.c
Created March 27, 2016 09:33 — forked from RickKimball/delay.c
msp430-gcc delay using inline asm
/**
* void delay(uint16 cnt) - using cpu cycle counting busy loop
*
* Sit in a tight loop until delayCycles instructions cycles
* have occurred. Not very power friendly. Not very interrupt
* friendly. In fact, you should disable interrupts before
* calling this function to insure accurate results.
*
* Note: minimum of 20 cycles
*
@CyberCircuits
CyberCircuits / gchart_offline.html
Created April 9, 2016 13:54 — forked from makevoid/gchart_offline.html
GChart offline example
<!--
How to use Google JS Visualization Api offline, step by step
this approach might work with other libraries loaded with google.load, after all it's still JavaScript!!!
-->
<!DOCTYPE html>
<html>
@CyberCircuits
CyberCircuits / gist:4454fba441fb433939da7561a6123416
Created July 11, 2016 04:19 — forked from casschin/gist:1990245
Python webdriver api quick sheet
### Locating UI elements ###
# By ID
<div id="coolestWidgetEvah">...</div>
element = driver.find_element_by_id("coolestWidgetEvah")
or
from selenium.webdriver.common.by import By
element = driver.find_element(by=By.ID, value="coolestWidgetEvah")
# By class name:
@CyberCircuits
CyberCircuits / How to setup VirtualGL and TurboVNC on Ubuntu.md
Created October 17, 2018 03:06 — forked from cyberang3l/How to setup VirtualGL and TurboVNC on Ubuntu.md
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
#!/bin/bash
#
# Compare two PDF files.
# Dependencies:
# - pdfinfo (xpdf)
# - pdfjam (texlive-extra-utils)
# - diffpdf
#
MAX_HEIGHT=15840 #The maximum height of a page (in points), limited by pdfjam.
@CyberCircuits
CyberCircuits / cc2538-and-openocd.md
Created January 16, 2025 20:59 — forked from leoheck/cc2538-and-openocd.md
Flashing CC13*2 using OpenOCD

Flashing CC13x2 with OpenOCD Using XDS110 and JTAG.

Install OpenOCD version 0.11.0 (or maybe higher)

You can also build it yourself.

Boards setup

If you are using Launchpads to experiment this setup, you are going to need to prepare them as it is being shown in this image.

jtag_chain2