]> oss.titaniummirror.com Git - rgblamp.git/commitdiff
Initial commit
authorR. Steve McKown <rsmckown@gmail.com>
Wed, 30 Nov 2011 23:37:12 +0000 (16:37 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Wed, 30 Nov 2011 23:37:12 +0000 (16:37 -0700)
17 files changed:
.dep.inc [new file with mode: 0644]
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
funclist [new file with mode: 0644]
main.c [new file with mode: 0644]
nbproject/.dep.inc [new file with mode: 0644]
nbproject/Makefile-default.mk [new file with mode: 0644]
nbproject/Makefile-genesis.properties [new file with mode: 0644]
nbproject/Makefile-impl.mk [new file with mode: 0644]
nbproject/Makefile-variables.mk [new file with mode: 0644]
nbproject/Package-default.bash [new file with mode: 0644]
nbproject/configurations.xml [new file with mode: 0644]
nbproject/private/configurations.xml [new file with mode: 0644]
nbproject/private/private.properties [new file with mode: 0644]
nbproject/private/private.xml [new file with mode: 0644]
nbproject/project.properties [new file with mode: 0644]
nbproject/project.xml [new file with mode: 0644]

diff --git a/.dep.inc b/.dep.inc
new file mode 100644 (file)
index 0000000..4560e55
--- /dev/null
+++ b/.dep.inc
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2247d5f
--- /dev/null
@@ -0,0 +1,2 @@
+/build
+/dist
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..05a3fb1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,108 @@
+#
+#  There exist several targets which are by default empty and which can be 
+#  used for execution of your targets. These targets are usually executed 
+#  before and after some main targets. They are: 
+#
+#     .build-pre:              called before 'build' target
+#     .build-post:             called after 'build' target
+#     .clean-pre:              called before 'clean' target
+#     .clean-post:             called after 'clean' target
+#     .clobber-pre:            called before 'clobber' target
+#     .clobber-post:           called after 'clobber' target
+#     .all-pre:                called before 'all' target
+#     .all-post:               called after 'all' target
+#     .help-pre:               called before 'help' target
+#     .help-post:              called after 'help' target
+#
+#  Targets beginning with '.' are not intended to be called on their own.
+#
+#  Main targets can be executed directly, and they are:
+#  
+#     build                    build a specific configuration
+#     clean                    remove built files from a configuration
+#     clobber                  remove all built files
+#     all                      build all configurations
+#     help                     print help mesage
+#  
+#  Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+#  .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+#  Available make variables:
+#
+#     CND_BASEDIR                base directory for relative paths
+#     CND_DISTDIR                default top distribution directory (build artifacts)
+#     CND_BUILDDIR               default top build directory (object files, ...)
+#     CONF                       name of current configuration
+#     CND_ARTIFACT_DIR_${CONF}   directory of build artifact (current configuration)
+#     CND_ARTIFACT_NAME_${CONF}  name of build artifact (current configuration)
+#     CND_ARTIFACT_PATH_${CONF}  path to build artifact (current configuration)
+#     CND_PACKAGE_DIR_${CONF}    directory of package (current configuration)
+#     CND_PACKAGE_NAME_${CONF}   name of package (current configuration)
+#     CND_PACKAGE_PATH_${CONF}   path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment 
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+RANLIB=ranlib
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
diff --git a/funclist b/funclist
new file mode 100644 (file)
index 0000000..e7ebb3d
--- /dev/null
+++ b/funclist
@@ -0,0 +1,8 @@
+_led_init: CODE, 1847 0 11
+_pwm_set: CODE, 1858 0 11
+_pic_init: CODE, 1837 0 10
+_delay: CODE, 1912 0 28
+_led_set: CODE, 1869 0 16
+_main: CODE, 1940 0 108
+_pwm_init: CODE, 1885 0 27
+Total: 211
\ No newline at end of file
diff --git a/main.c b/main.c
new file mode 100644 (file)
index 0000000..3e8a52d
--- /dev/null
+++ b/main.c
@@ -0,0 +1,116 @@
+/*
+ * File:   main.c
+ *
+ * Created on August 16, 2010, 12:09 PM
+ */
+
+
+#include <htc.h>
+#include <pic16f1827.h>
+
+#define RUNAT32MHZ /* else 16 MHz */
+#define BRIGHT_STEP     16 /* starts at 0 */
+#define BRIGHT_STEPS    16 /* includes 0 */
+#define LEDBIT          0x01 /* PORTB.3 */
+
+#if defined(RUNAT32MHZ)
+__CONFIG(WDTE_OFF & FOSC_INTOSC);
+__CONFIG(LVP_OFF & PLLEN_ON);
+#else
+__CONFIG(WDTE_OFF);
+__CONFIG(LVP_OFF);
+#endif
+
+void pic_init()
+{
+#if defined(RUNAT32MHZ)
+    OSCCON = 0b11110000;
+#else /* 16 MHz */
+    OSCCON = 0b01111010;
+#endif
+
+    /* OSCSTAT.HFIOFL is set when oscillator is locked (accurate within 2%) */
+    while (!HFIOFL);
+}
+
+void pwm_init()
+{
+    /* Initialize PWM on PORTB.0
+     * - Fosc = 32MHz
+     * - Prescale = 16
+     * - PRx value = 0xff
+     * = f(pwm) = 1.95 kHz
+     */
+
+    /* Disable output on PORTB.0 */
+    TRISB |= 0x08;
+
+    /* Configure ECCP1 */
+    CCP1CON = 0b00001100;
+    CCPR1L = 0; /* Initial PWM value; only using 8 LSBs */
+
+    /* Configure Timer2 */
+    CCPTMRS = CCPTMRS & ~0x03; /* bits 1:0 denote CCP1 uses Timer 2 */
+    TMR2IF = 0;
+    PR2 = 0xff;
+    T2CON = 0b00000111;
+
+    /* Enable PWM output, PORTB.0 */
+    while (!TMR2IF); /* wait until timer overflow */
+    TRISB &= ~0x08;
+}
+
+void led_init()
+{
+    PORTB &= ~LEDBIT; /* Led is PORTB.3 */
+    TRISB &= ~LEDBIT;
+}
+
+void led_set(unsigned short led)
+{
+    if (led)
+        PORTB |= LEDBIT;
+    else
+        PORTB &= ~LEDBIT;
+}
+
+void pwm_set(unsigned short step)
+{
+    CCPR1L = step * BRIGHT_STEP;
+}
+
+void delay()
+{
+    for (unsigned counter = 0; counter < 50000; counter++);
+}
+
+int main(void)
+{
+    unsigned short fwd = 1;
+    short int step = 0;
+    short int led = 0;
+
+    pic_init();
+    led_init();
+    pwm_init();
+    while (1) {
+        led = 1 - led;
+        led_set(led);
+        pwm_set(step);
+        if (fwd == 0) {
+            step--;
+            if (step == -1) {
+                fwd = 1;
+                step++;
+            }
+        } else /* fwd == 1 */ {
+            step++;
+            if (step == BRIGHT_STEPS) {
+                fwd = 0;
+                step--;
+            }
+        }
+        delay(); delay();
+    }
+    return 0;
+}
diff --git a/nbproject/.dep.inc b/nbproject/.dep.inc
new file mode 100644 (file)
index 0000000..4560e55
--- /dev/null
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/nbproject/Makefile-default.mk b/nbproject/Makefile-default.mk
new file mode 100644 (file)
index 0000000..777bc50
--- /dev/null
@@ -0,0 +1,132 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Include project Makefile
+include Makefile
+
+# Environment
+# Adding MPLAB X bin directory to path
+PATH:=/opt/microchip/mplabx/mplab_ide/mplab_ide/modules/../../bin/:$(PATH)
+MKDIR=mkdir -p
+RM=rm -f 
+MV=mv 
+CP=cp 
+
+# Macros
+CND_CONF=default
+ifeq ($(TYPE_IMAGE), DEBUG_RUN)
+IMAGE_TYPE=debug
+FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof
+else
+IMAGE_TYPE=production
+FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof
+endif
+
+# Object Directory
+OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
+
+# Distribution Directory
+DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
+
+# Object Files Quoted if spaced
+OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.p1
+
+# Object Files
+OBJECTFILES=${OBJECTDIR}/main.p1
+
+
+CFLAGS=
+ASFLAGS=
+LDLIBSOPTIONS=
+
+# Path to java used to run MPLAB X when this makefile was created
+MP_JAVA_PATH="/usr/lib/jvm/java-6-openjdk/jre/bin/"
+OS_CURRENT="$(shell uname -s)"
+############# Tool locations ##########################################
+# If you copy a project from one host to another, the path where the  #
+# compiler is installed may be different.                             #
+# If you open this project with MPLAB X in the new host, this         #
+# makefile will be regenerated and the paths will be corrected.       #
+#######################################################################
+MP_CC="/usr/hitech/picc/9.82/bin/picc"
+# MP_BC is not defined
+MP_AS="/usr/hitech/picc/9.82/bin/picc"
+MP_LD="/usr/hitech/picc/9.82/bin/picc"
+MP_AR="/usr/hitech/picc/9.82/bin/picc"
+DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/mplab_ide/mplab_ide/modules/../../bin/extractobjectdependencies.jar" 
+# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
+FIXDEPS=fixDeps
+MP_CC_DIR="/usr/hitech/picc/9.82/bin"
+# MP_BC_DIR is not defined
+MP_AS_DIR="/usr/hitech/picc/9.82/bin"
+MP_LD_DIR="/usr/hitech/picc/9.82/bin"
+MP_AR_DIR="/usr/hitech/picc/9.82/bin"
+# MP_BC_DIR is not defined
+
+.build-conf:  ${BUILD_SUBPROJECTS}
+       ${MAKE}  -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof
+
+MP_PROCESSOR_OPTION=16F1827
+# ------------------------------------------------------------------------------------
+# Rules for buildStep: assemble
+ifeq ($(TYPE_IMAGE), DEBUG_RUN)
+else
+endif
+
+# ------------------------------------------------------------------------------------
+# Rules for buildStep: compile
+ifeq ($(TYPE_IMAGE), DEBUG_RUN)
+${OBJECTDIR}/main.p1: main.c  nbproject/Makefile-${CND_CONF}.mk
+       @${MKDIR} ${OBJECTDIR} 
+       ${MP_CC} --pass1 main.c $(MP_EXTRA_CC_PRE) -q --chip=$(MP_PROCESSOR_OPTION) -P  --outdir=${OBJECTDIR} -N31 --warn=0 --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --summary=default,-psect,-class,+mem,-hex --opt=default,+asm,-asmfile,+speed,-space,-debug,-9 -D__DEBUG --debugger=pickit3  --double=24 --float=24 --addrqual=ignore --mode=lite -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s"
+       ${MP_CC} --scandep --pass1 main.c $(MP_EXTRA_CC_PRE) -q --chip=$(MP_PROCESSOR_OPTION) -P  --outdir=${OBJECTDIR} -N31 --warn=0 --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --opt=default,+asm,-asmfile,+speed,-space,-debug,-9 -D__DEBUG --debugger=pickit3  --double=24 --float=24 --addrqual=ignore --mode=lite -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s"
+       @echo ${OBJECTDIR}/main.p1: > ${OBJECTDIR}/main.p1.d
+       @cat ${OBJECTDIR}/main.dep >> ${OBJECTDIR}/main.p1.d
+       @${FIXDEPS} "${OBJECTDIR}/main.p1.d" $(SILENT) -ht 
+       
+else
+${OBJECTDIR}/main.p1: main.c  nbproject/Makefile-${CND_CONF}.mk
+       @${MKDIR} ${OBJECTDIR} 
+       ${MP_CC} --pass1 main.c $(MP_EXTRA_CC_PRE) -q --chip=$(MP_PROCESSOR_OPTION) -P  --outdir=${OBJECTDIR} -N31 --warn=0 --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --summary=default,-psect,-class,+mem,-hex --opt=default,+asm,-asmfile,+speed,-space,-debug,-9  --double=24 --float=24 --addrqual=ignore --mode=lite -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s"
+       ${MP_CC} --scandep --pass1 main.c $(MP_EXTRA_CC_PRE) -q --chip=$(MP_PROCESSOR_OPTION) -P  --outdir=${OBJECTDIR} -N31 --warn=0 --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --opt=default,+asm,-asmfile,+speed,-space,-debug,-9  --double=24 --float=24 --addrqual=ignore --mode=lite -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s"
+       @echo ${OBJECTDIR}/main.p1: > ${OBJECTDIR}/main.p1.d
+       @cat ${OBJECTDIR}/main.dep >> ${OBJECTDIR}/main.p1.d
+       @${FIXDEPS} "${OBJECTDIR}/main.p1.d" $(SILENT) -ht 
+       
+endif
+
+# ------------------------------------------------------------------------------------
+# Rules for buildStep: link
+ifeq ($(TYPE_IMAGE), DEBUG_RUN)
+dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof: ${OBJECTFILES}  nbproject/Makefile-${CND_CONF}.mk
+       @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} 
+       ${MP_LD} $(MP_EXTRA_LD_PRE) -odist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof -mdist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.map --summary=default,-psect,-class,+mem,-hex --chip=$(MP_PROCESSOR_OPTION) -P --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --summary=default,-psect,-class,+mem,-hex --opt=default,+asm,-asmfile,+speed,-space,-debug,-9 -D__DEBUG --debugger=pickit3 -N31 --warn=0  --double=24 --float=24 --addrqual=ignore --mode=lite --output=default,-inhx032 -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s" ${OBJECTFILES_QUOTED_IF_SPACED}  
+       @${RM} dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.hex
+else
+dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof: ${OBJECTFILES}  nbproject/Makefile-${CND_CONF}.mk
+       @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} 
+       ${MP_LD} $(MP_EXTRA_LD_PRE) -odist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof -mdist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.map --summary=default,-psect,-class,+mem,-hex --chip=$(MP_PROCESSOR_OPTION) -P --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,+stackcall,+clib --summary=default,-psect,-class,+mem,-hex --opt=default,+asm,-asmfile,+speed,-space,-debug,-9 -N31 --warn=0  --double=24 --float=24 --addrqual=ignore --mode=lite --output=default,-inhx032 -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s" ${OBJECTFILES_QUOTED_IF_SPACED}  
+endif
+
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf:
+       ${RM} -r build/default
+       ${RM} -r dist/default
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
diff --git a/nbproject/Makefile-genesis.properties b/nbproject/Makefile-genesis.properties
new file mode 100644 (file)
index 0000000..cdfa31e
--- /dev/null
@@ -0,0 +1,8 @@
+#
+#Wed Nov 30 15:32:39 MST 2011
+default.languagetoolchain.dir=/usr/hitech/picc/9.82/bin
+com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=11bb82e71763925c87fa30f6c65473b1
+default.languagetoolchain.version=9.82
+host.platform=linux
+conf.ids=default
+default.com-microchip-mplab-nbide-toolchainhitech-HitechPICCLanguageToolchain.md5=07bc5667573bd4afe405766894fbbb10
diff --git a/nbproject/Makefile-impl.mk b/nbproject/Makefile-impl.mk
new file mode 100644 (file)
index 0000000..4fc0029
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=picdimmy
+
+# Active Configuration
+DEFAULTCONF=default
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=default 
+
+
+# build
+.build-impl: .build-pre
+       ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre
+       ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+# dependency checking support
+.depcheck-impl:
+#      @echo "# This code depends on make tool being used" >.dep.inc
+#      @if [ -n "${MAKE_VERSION}" ]; then \
+#          echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+#          echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+#          echo "include \$${DEPFILES}" >>.dep.inc; \
+#          echo "endif" >>.dep.inc; \
+#      else \
+#          echo ".KEEP_STATE:" >>.dep.inc; \
+#          echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+#      fi
diff --git a/nbproject/Makefile-variables.mk b/nbproject/Makefile-variables.mk
new file mode 100644 (file)
index 0000000..effa418
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+# default configuration
+CND_ARTIFACT_DIR_default=dist/default/production
+CND_ARTIFACT_NAME_default=picdimmy.production.cof
+CND_ARTIFACT_PATH_default=dist/default/production/picdimmy.production.cof
+CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package
+CND_PACKAGE_NAME_default=picdimmy.tar
+CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/picdimmy.tar
diff --git a/nbproject/Package-default.bash b/nbproject/Package-default.bash
new file mode 100644 (file)
index 0000000..22870b1
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_CONF=default
+CND_DISTDIR=dist
+TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/picdimmy.${IMAGE_TYPE}.cof
+OUTPUT_BASENAME=picdimmy.${IMAGE_TYPE}.cof
+PACKAGE_TOP_DIR=picdimmy/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
+rm -rf ${TMPDIR}
+mkdir -p ${TMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory ${TMPDIR}/picdimmy/bin
+copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/package/picdimmy.tar
+cd ${TMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/picdimmy.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${TMPDIR}
diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml
new file mode 100644 (file)
index 0000000..fd8d0ba
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+  <logicalFolder name="root" displayName="root" projectFiles="true">
+    <logicalFolder name="HeaderFiles"
+                   displayName="Header Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="LibraryFiles"
+                   displayName="Library Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="ObjectFiles"
+                   displayName="Object Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="SourceFiles"
+                   displayName="Source Files"
+                   projectFiles="true">
+      <itemPath>main.c</itemPath>
+    </logicalFolder>
+    <logicalFolder name="ExternalFiles"
+                   displayName="Important Files"
+                   projectFiles="false">
+      <itemPath>Makefile</itemPath>
+    </logicalFolder>
+  </logicalFolder>
+  <projectmakefile>Makefile</projectmakefile>
+  <confs>
+    <conf name="default" type="2">
+      <toolsSet>
+        <developmentServer>localhost</developmentServer>
+        <targetDevice>PIC16F1827</targetDevice>
+        <targetHeader></targetHeader>
+        <platformTool>PICkit3PlatformTool</platformTool>
+        <languageToolchain>hi-tech-picc</languageToolchain>
+        <languageToolchainVersion>9.82</languageToolchainVersion>
+        <platform>2</platform>
+      </toolsSet>
+      <compileType>
+        <linkerTool>
+          <linkerLibItems>
+          </linkerLibItems>
+        </linkerTool>
+      </compileType>
+      <makeCustomizationType>
+        <makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
+        <makeCustomizationPreStep></makeCustomizationPreStep>
+        <makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
+        <makeCustomizationPostStep></makeCustomizationPostStep>
+        <makeCustomizationAlternativeFileToLoadEnabled>false</makeCustomizationAlternativeFileToLoadEnabled>
+        <makeCustomizationAlternativeFileToLoad></makeCustomizationAlternativeFileToLoad>
+        <makeCustomizationUseOfUserID>makeCustomizationUseOfUserID</makeCustomizationUseOfUserID>
+        <makeCustomizationUserID>makeCustomizationUserID</makeCustomizationUserID>
+      </makeCustomizationType>
+      <HI-TECH-COMP>
+      </HI-TECH-COMP>
+      <HI-TECH-LINK>
+      </HI-TECH-LINK>
+      <PICkit3PlatformTool>
+        <property key="programoptions.preserveprogramrange.end" value="0x7"/>
+        <property key="memories.id" value="false"/>
+        <property key="Freeze Peripherals" value="true"/>
+        <property key="programoptions.preserveeeprom" value="false"/>
+        <property key="programmertogo.imagename" value=""/>
+        <property key="memories.programmemory" value="true"/>
+        <property key="SecureSegment.SegmentProgramming" value="FullChipProgramming"/>
+        <property key="AutoSelectMemRanges" value="auto"/>
+        <property key="hwtoolclock.frcindebug" value="false"/>
+        <property key="programoptions.usehighvoltageonmclr" value="false"/>
+        <property key="memories.eeprom" value="false"/>
+        <property key="ToolFirmwareFilePath"
+                  value="Press to browse for a specific firmware version"/>
+        <property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
+        <property key="programoptions.preserveprogramrange.start" value="0x0"/>
+        <property key="voltagevalue" value="5.0"/>
+        <property key="programoptions.preserveprogramrange" value="false"/>
+        <property key="programoptions.eraseb4program" value="true"/>
+        <property key="memories.programmemory.start" value="0x0"/>
+        <property key="memories.programmemory.end" value="0xfff"/>
+        <property key="poweroptions.powerenable" value="true"/>
+      </PICkit3PlatformTool>
+    </conf>
+  </confs>
+</configurationDescriptor>
diff --git a/nbproject/private/configurations.xml b/nbproject/private/configurations.xml
new file mode 100644 (file)
index 0000000..003ef69
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="62">
+  <projectmakefile>Makefile</projectmakefile>
+  <defaultConf>0</defaultConf>
+  <confs>
+    <conf name="default" type="2">
+      <platformToolSN>:=MPLABCommUSB:=04D8:=900A:=0002:=Microchip Technology Inc.:=PICkit 3:=BUR112834994:=x:=en</platformToolSN>
+      <languageToolchainDir>/usr/hitech/picc/9.82/bin</languageToolchainDir>
+      <mdbdebugger version="1">
+        <placeholder1>place holder 1</placeholder1>
+        <placeholder2>place holder 2</placeholder2>
+      </mdbdebugger>
+      <runprofile version="6">
+        <args></args>
+        <rundir></rundir>
+        <buildfirst>true</buildfirst>
+        <console-type>0</console-type>
+        <terminal-type>0</terminal-type>
+        <remove-instrumentation>0</remove-instrumentation>
+        <environment>
+        </environment>
+      </runprofile>
+    </conf>
+  </confs>
+</configurationDescriptor>
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100644 (file)
index 0000000..8af8ccd
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
+        <file>file:/home/smckown/workspace/picdimmy/main.c</file>
+    </open-files>
+</project-private>
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644 (file)
index 0000000..7e803f1
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>com.microchip.mplab.nbide.embedded.makeproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/make-project/1">
+            <name>picdimmy</name>
+            <creation-uuid>edb99ec9-2c71-4461-a761-1abe0aa0f999</creation-uuid>
+            <make-project-type>0</make-project-type>
+            <c-extensions>c</c-extensions>
+            <cpp-extensions/>
+            <header-extensions/>
+            <sourceEncoding>ISO-8859-1</sourceEncoding>
+            <make-dep-projects/>
+        </data>
+    </configuration>
+</project>